a=int(eval(input()))

k=[]

for i in range(a):

    k.append(int(eval(input())))

k.sort()

result=1

for i in range(len(k)-1):

    if k[i]<k[i+1]:

        result+=1

print(result)
n=eval(input())

moti=[]

n=int(n)

for _ in range(n):

  moti.append(eval(input()))

moti=list(set(moti))



print((len(moti)))
a = int(eval(input()))
k = []
for i in range(a):
    k.append(int(eval(input())))
k.sort()
result = 1
for i in range(len(k) - 1):
    if k[i] < k[i + 1]:
        result += 1
print(result)

n = eval(input())
moti = []
n = int(n)
for _ in range(n):
    moti.append(eval(input()))
moti = list(set(moti))
print((len(moti)))

-a = int(eval(input())) -k = [] -for i in range(a): -    k.append(int(eval(input()))) -k.sort() -result = 1 -for i in range(len(k) - 1): -    if k[i] < k[i + 1]: -        result += 1 -print(result) +n = eval(input()) +moti = [] +n = int(n) +for _ in range(n): +    moti.append(eval(input())) +moti = list(set(moti)) +print((len(moti)))