n = int(eval(input()))

s = []

for _ in range(n):

    s.append(eval(input()))



s.sort()



ans = n

for i in range(n-1):

    if s[i] == s[i+1]:

        ans -= 1



print(ans)
n = int(eval(input()))

s = []

for _ in range(n):

    s.append(eval(input()))



types = set(s)

print((len(types)))
n = int(eval(input()))
s = []
for _ in range(n):
    s.append(eval(input()))
s.sort()
ans = n
for i in range(n - 1):
    if s[i] == s[i + 1]:
        ans -= 1
print(ans)

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

-s.sort() -ans = n -for i in range(n - 1): -    if s[i] == s[i + 1]: -        ans -= 1 -print(ans) +types = set(s) +print((len(types)))