s=list(eval(input()))

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

ans=0

for i in range(3):

  if s[i]=="1":

    ans+=1

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

s = eval(input())
ans = 0
for i in range(3):
    if s[i] == "1":
        ans += 1
print(ans)

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