from collections import Counter 

n = int(eval(input()))

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

m = int(eval(input()))

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



cs = Counter(s)

ct = Counter(t)

ans = 0

for k, v in list(cs.items()):

    if k in list(ct.keys()):

        ans = max(ans, v-ct[k])

    else:

        ans = max(ans, v)



print(ans)
from collections import Counter

N = int(eval(input()))

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

M = int(eval(input()))

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

cs = Counter(s)

ct = Counter(t)



ans = 0

for k, v in list(cs.items()):

    tmp = v

    if k in list(ct.keys()):

        tmp -= ct[k]



    ans = max(ans, tmp)



print(ans)

from collections import Counter

n = int(eval(input()))
s = [eval(input()) for _ in range(n)]
m = int(eval(input()))
t = [eval(input()) for _ in range(m)]
cs = Counter(s)
ct = Counter(t)
ans = 0
for k, v in list(cs.items()):
    if k in list(ct.keys()):
        ans = max(ans, v - ct[k])
    else:
        ans = max(ans, v)
print(ans)

from collections import Counter

N = int(eval(input()))
s = [eval(input()) for _ in range(N)]
M = int(eval(input()))
t = [eval(input()) for _ in range(M)]
cs = Counter(s)
ct = Counter(t)
ans = 0
for k, v in list(cs.items()):
    tmp = v
    if k in list(ct.keys()):
        tmp -= ct[k]
    ans = max(ans, tmp)
print(ans)

-n = int(eval(input())) -s = [eval(input()) for _ in range(n)] -m = int(eval(input())) -t = [eval(input()) for _ in range(m)] +N = int(eval(input())) +s = [eval(input()) for _ in range(N)] +M = int(eval(input())) +t = [eval(input()) for _ in range(M)] +    tmp = v -        ans = max(ans, v - ct[k]) -    else: -        ans = max(ans, v) +        tmp -= ct[k] +    ans = max(ans, tmp)