test=list(eval(input()))

sum=0

for i in range(3):

	if test[i]=='1':

		sum += 1

print(sum)

s=list(eval(input()))

print((s.count("1")))
test = list(eval(input()))
sum = 0
for i in range(3):
    if test[i] == "1":
        sum += 1
print(sum)

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

-test = list(eval(input())) -sum = 0 -for i in range(3): -    if test[i] == "1": -        sum += 1 -print(sum) +s = list(eval(input())) +print((s.count("1")))