N = int(eval(input()))

ls = { eval(input()) for i in range(N)}

print((len(ls)))
N = int(eval(input()))

print((len({ eval(input()) for i in range(N) })))
N = int(eval(input()))
ls = {eval(input()) for i in range(N)}
print((len(ls)))

N = int(eval(input()))
print((len({eval(input()) for i in range(N)})))

-ls = {eval(input()) for i in range(N)} -print((len(ls))) +print((len({eval(input()) for i in range(N)})))