n = int(eval(input()))

d = [int(eval(input()))for _ in range(n)]

d = sorted(d, reverse=True)

cnt = 1

for i in range(1, n):

    if d[i] < d[i-1]:

        cnt += 1

print(cnt)

n = int(eval(input()))

d = [int(eval(input())) for _ in range(n)]

d = sorted(d, reverse=True)

cnt = 0

last = 10 ** 9

for i in d:

    if i < last:

        last = i

        cnt += 1

print(cnt)

n = int(eval(input()))
d = [int(eval(input())) for _ in range(n)]
d = sorted(d, reverse=True)
cnt = 1
for i in range(1, n):
    if d[i] < d[i - 1]:
        cnt += 1
print(cnt)

n = int(eval(input()))
d = [int(eval(input())) for _ in range(n)]
d = sorted(d, reverse=True)
cnt = 0
last = 10**9
for i in d:
    if i < last:
        last = i
        cnt += 1
print(cnt)

-cnt = 1 -for i in range(1, n): -    if d[i] < d[i - 1]: +cnt = 0 +last = 10**9 +for i in d: +    if i < last: +        last = i