from collections import Counter  



blue = []

red = []

N = int(eval(input()))

for i in range(N):

    blue.append(eval(input()))

M = int(eval(input()))

for j in range(M):

    red.append(eval(input()))

b = Counter(blue)

r = Counter(red)

print((max([0] + [b[x] - r[x] for x in b])))

N = int(eval(input()))

dic = {}

for i in range(N):

  s = eval(input())

  if s not in dic:

    dic[s] = 1

  else:

    dic[s] += 1

M = int(eval(input()))

for i in range(M):

  s = eval(input())

  if s not in dic:

    dic[s] = -1

  else:

    dic[s] -= 1

lst = list(dic.values())

lst.append(0)

print((max(lst)))
from collections import Counter

blue = []
red = []
N = int(eval(input()))
for i in range(N):
    blue.append(eval(input()))
M = int(eval(input()))
for j in range(M):
    red.append(eval(input()))
b = Counter(blue)
r = Counter(red)
print((max([0] + [b[x] - r[x] for x in b])))

N = int(eval(input()))
dic = {}
for i in range(N):
    s = eval(input())
    if s not in dic:
        dic[s] = 1
    else:
        dic[s] += 1
M = int(eval(input()))
for i in range(M):
    s = eval(input())
    if s not in dic:
        dic[s] = -1
    else:
        dic[s] -= 1
lst = list(dic.values())
lst.append(0)
print((max(lst)))

-from collections import Counter - -blue = [] -red = [] +dic = {} -    blue.append(eval(input())) +    s = eval(input()) +    if s not in dic: +        dic[s] = 1 +    else: +        dic[s] += 1 -for j in range(M): -    red.append(eval(input())) -b = Counter(blue) -r = Counter(red) -print((max([0] + [b[x] - r[x] for x in b]))) +for i in range(M): +    s = eval(input()) +    if s not in dic: +        dic[s] = -1 +    else: +        dic[s] -= 1 +lst = list(dic.values()) +lst.append(0) +print((max(lst)))