set2=set()

N=int(eval(input()))

ans=0

for i in range(N):

  s=eval(input())

  if not s in set2:

    ans+=1

    set2.add(s)

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

t=set()

for i in range(n):

  s=eval(input())

  t.add(s)

print((len(t)))
set2 = set()
N = int(eval(input()))
ans = 0
for i in range(N):
    s = eval(input())
    if not s in set2:
        ans += 1
        set2.add(s)
print(ans)

n = int(eval(input()))
t = set()
for i in range(n):
    s = eval(input())
    t.add(s)
print((len(t)))

-set2 = set() -N = int(eval(input())) -ans = 0 -for i in range(N): +n = int(eval(input())) +t = set() +for i in range(n): -    if not s in set2: -        ans += 1 -        set2.add(s) -print(ans) +    t.add(s) +print((len(t)))