s = []
while True:
    a = int(input())
    if a == 0:
        break
    s.append(a)
print(sum(s))