import math


def calculateFuelForMass(mass):
    return math.floor(mass / 3) - 2


def calculateTotalFuelForMass(mass):
    fuel = totalFuel = calculateFuelForMass(mass)
    while fuel > 0:
        fuel = calculateFuelForMass(fuel)
        if fuel > 0:
            totalFuel += fuel
    return totalFuel


moduleMasses = [calculateTotalFuelForMass(int(x)) for x in open('input.txt')]
moduleSum = sum(moduleMasses)
print('Sum is %i' % moduleSum)

974bee4ce88c0234d2071a161d0c5d35a6c77e05
<mask token>


def calculateFuelForMass(mass):
    return math.floor(mass / 3) - 2


def calculateTotalFuelForMass(mass):
    fuel = totalFuel = calculateFuelForMass(mass)
    while fuel > 0:
        fuel = calculateFuelForMass(fuel)
        if fuel > 0:
            totalFuel += fuel
    return totalFuel


<mask token>

<mask token>


def calculateFuelForMass(mass):
    return math.floor(mass / 3) - 2


def calculateTotalFuelForMass(mass):
    fuel = totalFuel = calculateFuelForMass(mass)
    while fuel > 0:
        fuel = calculateFuelForMass(fuel)
        if fuel > 0:
            totalFuel += fuel
    return totalFuel


<mask token>
print('Sum is %i' % moduleSum)

<mask token>


def calculateFuelForMass(mass):
    return math.floor(mass / 3) - 2


def calculateTotalFuelForMass(mass):
    fuel = totalFuel = calculateFuelForMass(mass)
    while fuel > 0:
        fuel = calculateFuelForMass(fuel)
        if fuel > 0:
            totalFuel += fuel
    return totalFuel


moduleMasses = [calculateTotalFuelForMass(int(x)) for x in open('input.txt')]
moduleSum = sum(moduleMasses)
print('Sum is %i' % moduleSum)

import math


def calculateFuelForMass(mass):
    return math.floor(mass / 3) - 2


def calculateTotalFuelForMass(mass):
    fuel = totalFuel = calculateFuelForMass(mass)
    while fuel > 0:
        fuel = calculateFuelForMass(fuel)
        if fuel > 0:
            totalFuel += fuel
    return totalFuel


moduleMasses = [calculateTotalFuelForMass(int(x)) for x in open('input.txt')]
moduleSum = sum(moduleMasses)
print('Sum is %i' % moduleSum)
