l = [ int(x) for x in input().split() ]

l = set(l)

print((len(list(l))))

l = [ int(x) for x in input().split() ]

print((len(set(l))))

l = [int(x) for x in input().split()]
l = set(l)
print((len(list(l))))

l = [int(x) for x in input().split()]
print((len(set(l))))

-l = set(l) -print((len(list(l)))) +print((len(set(l))))