import collections



N = int(eval(input()))

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

M = int(eval(input()))

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

cs = collections.Counter(s)

ct = collections.Counter(t)

ans = 0

for k in list(cs.keys()):

#  print(k, cs[k], ct[k])

  c = cs[k] - ct[k]

  if c > ans:

    ans = c

print((max(ans, 0)))
N = int(eval(input())) 

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

M = int(eval(input()))

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



from collections import Counter

sc = Counter(s)

tc = Counter(t)



print((max(0, max([sc[i] - tc[i] for i in sc]))))

  
import collections

N = int(eval(input()))
s = [eval(input()) for i in range(N)]
M = int(eval(input()))
t = [eval(input()) for i in range(M)]
cs = collections.Counter(s)
ct = collections.Counter(t)
ans = 0
for k in list(cs.keys()):
    #  print(k, cs[k], ct[k])
    c = cs[k] - ct[k]
    if c > ans:
        ans = c
print((max(ans, 0)))

N = int(eval(input()))
s = [eval(input()) for _ in range(N)]
M = int(eval(input()))
t = [eval(input()) for _ in range(M)]
from collections import Counter

sc = Counter(s)
tc = Counter(t)
print((max(0, max([sc[i] - tc[i] for i in sc]))))

-import collections +N = int(eval(input())) +s = [eval(input()) for _ in range(N)] +M = int(eval(input())) +t = [eval(input()) for _ in range(M)] +from collections import Counter -N = int(eval(input())) -s = [eval(input()) for i in range(N)] -M = int(eval(input())) -t = [eval(input()) for i in range(M)] -cs = collections.Counter(s) -ct = collections.Counter(t) -ans = 0 -for k in list(cs.keys()): -    #  print(k, cs[k], ct[k]) -    c = cs[k] - ct[k] -    if c > ans: -        ans = c -print((max(ans, 0))) +sc = Counter(s) +tc = Counter(t) +print((max(0, max([sc[i] - tc[i] for i in sc]))))