n=int(eval(input()))

d=dict()



for i in range(n):

  s="".join(eval(input()))

  #print(s)

  if s in d:

    d[s]+=1

  else:

    d[s]=1

ans=0

for x in list(d.values()):

  ans+=1

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

kk=set()

for i in range(n):

  s=eval(input())

  kk.add(s)

print((len(kk)))
n = int(eval(input()))
d = dict()
for i in range(n):
    s = "".join(eval(input()))
    # print(s)
    if s in d:
        d[s] += 1
    else:
        d[s] = 1
ans = 0
for x in list(d.values()):
    ans += 1
print(ans)

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

-d = dict() +kk = set() -    s = "".join(eval(input())) -    # print(s) -    if s in d: -        d[s] += 1 -    else: -        d[s] = 1 -ans = 0 -for x in list(d.values()): -    ans += 1 -print(ans) +    s = eval(input()) +    kk.add(s) +print((len(kk)))