line = eval(input())

count = 0

for i in range(3):

  if line[i] == "1":

    count += 1

print(count)
line = eval(input())

answer = line.count("1")

print(answer)
line = eval(input())
count = 0
for i in range(3):
    if line[i] == "1":
        count += 1
print(count)

line = eval(input())
answer = line.count("1")
print(answer)

-count = 0 -for i in range(3): -    if line[i] == "1": -        count += 1 -print(count) +answer = line.count("1") +print(answer)