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

a = number.count("1")

print(a)

print((input().count("1")))

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

-print((input().count("1"))) +number = eval(input()) +a = number.count("1") +print(a)