N = int(eval(input()))



d = {}

for _ in range(N):

    S = eval(input())

    d.setdefault(S, 0)

    d[S] += 1

print((len(list(d.keys()))))

N = int(eval(input()))



print((len(set(eval(input()) for _ in range(N)))))

N = int(eval(input()))
d = {}
for _ in range(N):
    S = eval(input())
    d.setdefault(S, 0)
    d[S] += 1
print((len(list(d.keys()))))

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

-d = {} -for _ in range(N): -    S = eval(input()) -    d.setdefault(S, 0) -    d[S] += 1 -print((len(list(d.keys())))) +print((len(set(eval(input()) for _ in range(N)))))