s = eval(input())

s1 = s[0]

s2 = s[1]

s3 = s[2]

n = 0

if s1 == '1':

  n = n + 1

if s2 == '1':

  n = n + 1

if s3 == '1':

  n = n + 1

print (n)
s = eval(input())

n = 0

if s[0] == '1':

  n = n + 1

if s[1] == '1':

  n = n + 1

if s[2] == '1':

  n = n + 1

print (n)
s = eval(input())
s1 = s[0]
s2 = s[1]
s3 = s[2]
n = 0
if s1 == "1":
    n = n + 1
if s2 == "1":
    n = n + 1
if s3 == "1":
    n = n + 1
print(n)

s = eval(input())
n = 0
if s[0] == "1":
    n = n + 1
if s[1] == "1":
    n = n + 1
if s[2] == "1":
    n = n + 1
print(n)

-s1 = s[0] -s2 = s[1] -s3 = s[2] -if s1 == "1": +if s[0] == "1": -if s2 == "1": +if s[1] == "1": -if s3 == "1": +if s[2] == "1":