x,y,z = list(map(int,input().split()))

if x == y and y==z:

  print((1))

elif x == y or y == z or z ==x :

  print((2))

else:

  print((3))

a,b,c = list(map(int, input().split()))

if a==b==c:

  print((1))

elif a==b or b==c or a==c:

  print((2))

else:

  print((3))
x, y, z = list(map(int, input().split()))
if x == y and y == z:
    print((1))
elif x == y or y == z or z == x:
    print((2))
else:
    print((3))

a, b, c = list(map(int, input().split()))
if a == b == c:
    print((1))
elif a == b or b == c or a == c:
    print((2))
else:
    print((3))

-x, y, z = list(map(int, input().split())) -if x == y and y == z: +a, b, c = list(map(int, input().split())) +if a == b == c: -elif x == y or y == z or z == x: +elif a == b or b == c or a == c: