aaa = list(eval(input()))

bag = []

if aaa[0] == "1":

    bag.append(1)

if aaa[1] == "1":

    bag.append(1)

if aaa[2] == "1":

    bag.append(1)

print((len(bag)))
num = eval(input())

count = [1 for i in range(len(num)) if num[i] =="1"]

print((len(count)))
aaa = list(eval(input()))
bag = []
if aaa[0] == "1":
    bag.append(1)
if aaa[1] == "1":
    bag.append(1)
if aaa[2] == "1":
    bag.append(1)
print((len(bag)))

num = eval(input())
count = [1 for i in range(len(num)) if num[i] == "1"]
print((len(count)))

-aaa = list(eval(input())) -bag = [] -if aaa[0] == "1": -    bag.append(1) -if aaa[1] == "1": -    bag.append(1) -if aaa[2] == "1": -    bag.append(1) -print((len(bag))) +num = eval(input()) +count = [1 for i in range(len(num)) if num[i] == "1"] +print((len(count)))