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)]

ss = set(s)

sl = Counter(s)

tl = Counter(t)

goukei=[]

for i in ss:

  goukei.append(sl[i]-tl[i])

  

if max(goukei) > 0:

  print((max(goukei)))

else:

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

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

m = int(eval(input()))

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

ans = 0

for i in set(s):

  tmp = s.count(i)-t.count(i)

  if ans < tmp:

    ans = tmp 

print(ans)
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)]
ss = set(s)
sl = Counter(s)
tl = Counter(t)
goukei = []
for i in ss:
    goukei.append(sl[i] - tl[i])
if max(goukei) > 0:
    print((max(goukei)))
else:
    print((0))

n = int(eval(input()))
s = [eval(input()) for i in range(n)]
m = int(eval(input()))
t = [eval(input()) for i in range(m)]
ans = 0
for i in set(s):
    tmp = s.count(i) - t.count(i)
    if ans < tmp:
        ans = tmp
print(ans)

-from collections import Counter - -ss = set(s) -sl = Counter(s) -tl = Counter(t) -goukei = [] -for i in ss: -    goukei.append(sl[i] - tl[i]) -if max(goukei) > 0: -    print((max(goukei))) -else: -    print((0)) +ans = 0 +for i in set(s): +    tmp = s.count(i) - t.count(i) +    if ans < tmp: +        ans = tmp +print(ans)