import collections

n = int(eval(input()))

b = [eval(input()) for _ in range(n)]

m = int(eval(input()))

r = [eval(input()) for _ in range(m)]

bc = collections.Counter(b)

rc = collections.Counter(r)

ans = 0

for x in list(bc.keys()):

  ans = max(ans, bc[x]-rc[x])

print(ans)
import collections

n = int(eval(input()))

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

m = int(eval(input()))

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



sc = collections.Counter(s)

tc = collections.Counter(t)

ans = 0

for x in list(sc.keys()):

  ans = max(ans,sc[x]-tc[x])

print(ans)
import collections

n = int(eval(input()))
b = [eval(input()) for _ in range(n)]
m = int(eval(input()))
r = [eval(input()) for _ in range(m)]
bc = collections.Counter(b)
rc = collections.Counter(r)
ans = 0
for x in list(bc.keys()):
    ans = max(ans, bc[x] - rc[x])
print(ans)

import collections

n = int(eval(input()))
s = [eval(input()) for _ in range(n)]
m = int(eval(input()))
t = [eval(input()) for _ in range(m)]
sc = collections.Counter(s)
tc = collections.Counter(t)
ans = 0
for x in list(sc.keys()):
    ans = max(ans, sc[x] - tc[x])
print(ans)

-b = [eval(input()) for _ in range(n)] +s = [eval(input()) for _ in range(n)] -r = [eval(input()) for _ in range(m)] -bc = collections.Counter(b) -rc = collections.Counter(r) +t = [eval(input()) for _ in range(m)] +sc = collections.Counter(s) +tc = collections.Counter(t) -for x in list(bc.keys()): -    ans = max(ans, bc[x] - rc[x]) +for x in list(sc.keys()): +    ans = max(ans, sc[x] - tc[x])