N=int(eval(input()))

d=[eval(input()) for i in range(N)]

print((len(set(d))))
n=int(eval(input()))

a=[int(eval(input())) for i in range(n)]

print((len(set(a))))

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

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

-N = int(eval(input())) -d = [eval(input()) for i in range(N)] -print((len(set(d)))) +n = int(eval(input())) +a = [int(eval(input())) for i in range(n)] +print((len(set(a))))