s = eval(input ())

c = 0

for i in range (3):

    if s[i] == '1':

        c += 1

print (c)
a = eval(input ())

print((a.count ('1')))

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

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

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