n = eval(input())

a = int(n[0]) + int(n[1]) + int(n[2])

print(a)
s = list(eval(input()))

print((s.count("1")))
n = eval(input())
a = int(n[0]) + int(n[1]) + int(n[2])
print(a)

s = list(eval(input()))
print((s.count("1")))

-n = eval(input()) -a = int(n[0]) + int(n[1]) + int(n[2]) -print(a) +s = list(eval(input())) +print((s.count("1")))