summaryrefslogtreecommitdiffstats
path: root/solutions/py/01-1.py
blob: 598caf446f6541927ff0c56ec34dc62cc01e4e71 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
import math
import sys

s = 0
for line in sys.stdin:
    mass = int(line)
    if mass == 0:
        break
    fuel = math.floor(mass / 3) - 2
    s += fuel
print(s)