print((len(set([int(eval(input())) for _ in range(int(eval(input())))]))))
N = int(eval(input()))

D = [int(eval(input())) for _ in range(N)]

print((len(set(D))))
print((len(set([int(eval(input())) for _ in range(int(eval(input())))]))))

N = int(eval(input()))
D = [int(eval(input())) for _ in range(N)]
print((len(set(D))))

-print((len(set([int(eval(input())) for _ in range(int(eval(input())))])))) +N = int(eval(input())) +D = [int(eval(input())) for _ in range(N)] +print((len(set(D))))