def calc_total_fuel_for_mass(mass:int) -> int:
    """Calculates the total amount of fuel needed for a given mass, including its needed fuel mass."""
    fuel = (mass // 3) - 2
    if fuel <= 0:
        return 0
    return fuel + calc_total_fuel_for_mass(fuel)