N = int(eval(input()))

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

A.sort(reverse=True)

count = 0



for i in range(N):

    for j in range(i+1,N):

        if A[i] == A[j] and A[i]!=0:

            A[j] = 0

            count += 1

        

print((len(A)-count))

N = int(eval(input()))

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

A.sort(reverse=True)

count = 0



m = set(A)

        

print((len(m)))

N = int(eval(input()))
A = [int(eval(input())) for i in range(N)]
A.sort(reverse=True)
count = 0
for i in range(N):
    for j in range(i + 1, N):
        if A[i] == A[j] and A[i] != 0:
            A[j] = 0
            count += 1
print((len(A) - count))

N = int(eval(input()))
A = [int(eval(input())) for i in range(N)]
A.sort(reverse=True)
count = 0
m = set(A)
print((len(m)))

-for i in range(N): -    for j in range(i + 1, N): -        if A[i] == A[j] and A[i] != 0: -            A[j] = 0 -            count += 1 -print((len(A) - count)) +m = set(A) +print((len(m)))