li = list(eval(input()))

counter = 0

for i in li:

   counter += int(i)

print(counter)
li = list(eval(input()))

counter = int(li[0]) + int(li[1]) + int(li[2])

print(counter)
li = list(eval(input()))
counter = 0
for i in li:
    counter += int(i)
print(counter)

li = list(eval(input()))
counter = int(li[0]) + int(li[1]) + int(li[2])
print(counter)

-counter = 0 -for i in li: -    counter += int(i) +counter = int(li[0]) + int(li[1]) + int(li[2])