N = int(eval(input()))

D = dict()

for i in range(N):

    S = eval(input())

    if S not in list(D.keys()):

        D[S] = 1

    D[S] += 1



print((len(D)))
n = int(eval(input()))

s = set()

for i in range(n):

    s.add(eval(input()))



print((len(s)))
N = int(eval(input()))
D = dict()
for i in range(N):
    S = eval(input())
    if S not in list(D.keys()):
        D[S] = 1
    D[S] += 1
print((len(D)))

n = int(eval(input()))
s = set()
for i in range(n):
    s.add(eval(input()))
print((len(s)))

-N = int(eval(input())) -D = dict() -for i in range(N): -    S = eval(input()) -    if S not in list(D.keys()): -        D[S] = 1 -    D[S] += 1 -print((len(D))) +n = int(eval(input())) +s = set() +for i in range(n): +    s.add(eval(input())) +print((len(s)))