N = int(eval(input()))

S = [eval(input()) for _ in range(N)]  

S.sort()

uni_count = 1

for i in range(N-1):

    if(S[i+1]!=S[i]):

        uni_count += 1

print(uni_count)

N = int(eval(input()))

S = [eval(input()) for _ in range(N)]  



print((len(set(S))))

N = int(eval(input()))
S = [eval(input()) for _ in range(N)]
S.sort()
uni_count = 1
for i in range(N - 1):
    if S[i + 1] != S[i]:
        uni_count += 1
print(uni_count)

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

-S.sort() -uni_count = 1 -for i in range(N - 1): -    if S[i + 1] != S[i]: -        uni_count += 1 -print(uni_count) +print((len(set(S))))