def fuel_required(mass):
    """
    Calculates the amount of fuel required for a given mass.  Returns 0 if no fuel required (because less than zero).
    """

    new_fuel_required = mass // 3 - 2
    #Base case
    if new_fuel_required <= 0:
        return 0
    
    return new_fuel_required + fuel_required(new_fuel_required)