dic = {}



N = int(eval(input()))

s = [eval(input()) for i in range(N)]

for i in range(N):

  dic.setdefault(s[i],0)

  dic[s[i]] += 1

  

M = int(eval(input()))

t = [eval(input()) for j in range(M)]

for j in range(M):

  dic.setdefault(t[j],0)

  dic[t[j]] -= 1



if max(dic.values()) > 0:

  print((max(dic.values())))

else:

  print((0))
dic = {}



N = int(eval(input()))

for k in range(N):

  i = eval(input())

  if i in dic:

    dic[i] += 1

  else:

    dic[i] = 1



M = int(eval(input()))

for j in range(M):

  i = eval(input())

  if i in dic:

    dic[i] -= 1



print((max(max(dic.values()), 0)))
dic = {}
N = int(eval(input()))
s = [eval(input()) for i in range(N)]
for i in range(N):
    dic.setdefault(s[i], 0)
    dic[s[i]] += 1
M = int(eval(input()))
t = [eval(input()) for j in range(M)]
for j in range(M):
    dic.setdefault(t[j], 0)
    dic[t[j]] -= 1
if max(dic.values()) > 0:
    print((max(dic.values())))
else:
    print((0))

dic = {}
N = int(eval(input()))
for k in range(N):
    i = eval(input())
    if i in dic:
        dic[i] += 1
    else:
        dic[i] = 1
M = int(eval(input()))
for j in range(M):
    i = eval(input())
    if i in dic:
        dic[i] -= 1
print((max(max(dic.values()), 0)))

-s = [eval(input()) for i in range(N)] -for i in range(N): -    dic.setdefault(s[i], 0) -    dic[s[i]] += 1 +for k in range(N): +    i = eval(input()) +    if i in dic: +        dic[i] += 1 +    else: +        dic[i] = 1 -t = [eval(input()) for j in range(M)] -    dic.setdefault(t[j], 0) -    dic[t[j]] -= 1 -if max(dic.values()) > 0: -    print((max(dic.values()))) -else: -    print((0)) +    i = eval(input()) +    if i in dic: +        dic[i] -= 1 +print((max(max(dic.values()), 0)))