a = eval(input())

b = a.count('1')

print((1*b))
a = eval(input())

b = a.count('1')

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

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

-print((1 * b)) +print(b)