#8th

n = int(eval(input()))

a = set(float(eval(input())) for i in range(n))

# a_ = [[int(i) for i in input()] for j in range(n)]

# a = set(_[0] for _ in a_)

print((len(a)))
n = int(eval(input()))

print((len(set(map(int, [eval(input()) for i in range(n)])))))
# 8th
n = int(eval(input()))
a = set(float(eval(input())) for i in range(n))
# a_ = [[int(i) for i in input()] for j in range(n)]
# a = set(_[0] for _ in a_)
print((len(a)))

n = int(eval(input()))
print((len(set(map(int, [eval(input()) for i in range(n)])))))

-# 8th -a = set(float(eval(input())) for i in range(n)) -# a_ = [[int(i) for i in input()] for j in range(n)] -# a = set(_[0] for _ in a_) -print((len(a))) +print((len(set(map(int, [eval(input()) for i in range(n)])))))