n = int(eval(input()))

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

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

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

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

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

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