a = eval(input())

one_number = a.count('1')

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

if a == '111':

  print((3))

elif a == '110' or a== '101' or a == '011':

  print((2))

elif a == '100' or a == '010' or a == '001':

  print((1))

else:

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

a = eval(input())
if a == "111":
    print((3))
elif a == "110" or a == "101" or a == "011":
    print((2))
elif a == "100" or a == "010" or a == "001":
    print((1))
else:
    print((0))

-one_number = a.count("1") -print((1 * one_number)) +if a == "111": +    print((3)) +elif a == "110" or a == "101" or a == "011": +    print((2)) +elif a == "100" or a == "010" or a == "001": +    print((1)) +else: +    print((0))