N = int(eval(input()))

d = list()

for n in range(N):

    d.append(int(eval(input())))

d = sorted(d, reverse=True)

ans = 1

for i, n in enumerate(d):

    if i == len(d) - 1:

        break

    if n > d[i + 1]:

        ans += 1

print(ans)

N = int(eval(input()))

d = list()

for n in range(N):

    d.append(int(eval(input())))



print((len(set(d))))

N = int(eval(input()))
d = list()
for n in range(N):
    d.append(int(eval(input())))
d = sorted(d, reverse=True)
ans = 1
for i, n in enumerate(d):
    if i == len(d) - 1:
        break
    if n > d[i + 1]:
        ans += 1
print(ans)

N = int(eval(input()))
d = list()
for n in range(N):
    d.append(int(eval(input())))
print((len(set(d))))

-d = sorted(d, reverse=True) -ans = 1 -for i, n in enumerate(d): -    if i == len(d) - 1: -        break -    if n > d[i + 1]: -        ans += 1 -print(ans) +print((len(set(d))))