s = eval(input())

print((s.count('1')))
x = 0

for i in list(eval(input())):

    if i == "1" :

        x += 1

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

x = 0
for i in list(eval(input())):
    if i == "1":
        x += 1
print(x)

-s = eval(input()) -print((s.count("1"))) +x = 0 +for i in list(eval(input())): +    if i == "1": +        x += 1 +print(x)