print((len(set(eval(input()) for i in range(int(eval(input())))))))
n=int(eval(input()))

d=len(set(list(int(eval(input())) for i in range(n))))

print(d)
print((len(set(eval(input()) for i in range(int(eval(input())))))))

n = int(eval(input()))
d = len(set(list(int(eval(input())) for i in range(n))))
print(d)

-print((len(set(eval(input()) for i in range(int(eval(input()))))))) +n = int(eval(input())) +d = len(set(list(int(eval(input())) for i in range(n)))) +print(d)