from collections import Counter

N = int(eval(input()))

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

M = int(eval(input()))

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



nums = []

for s in list(scounter.keys()):

    nums.append(scounter[s] - tcounter[s])



max_num = max(nums)

print((max_num if max_num > 0 else 0))

from collections import Counter



N = int(eval(input()))

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



M = int(eval(input()))

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

ans = 0

for s in sc.most_common():

    k, v = s

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

print(ans)

from collections import Counter

N = int(eval(input()))
scounter = Counter([eval(input()) for _ in range(N)])
M = int(eval(input()))
tcounter = Counter([eval(input()) for _ in range(M)])
nums = []
for s in list(scounter.keys()):
    nums.append(scounter[s] - tcounter[s])
max_num = max(nums)
print((max_num if max_num > 0 else 0))

from collections import Counter

N = int(eval(input()))
sc = Counter([eval(input()) for _ in range(N)])
M = int(eval(input()))
tc = Counter([eval(input()) for _ in range(M)])
ans = 0
for s in sc.most_common():
    k, v = s
    ans = max(ans, v - tc[k])
print(ans)

-scounter = Counter([eval(input()) for _ in range(N)]) +sc = Counter([eval(input()) for _ in range(N)]) -tcounter = Counter([eval(input()) for _ in range(M)]) -nums = [] -for s in list(scounter.keys()): -    nums.append(scounter[s] - tcounter[s]) -max_num = max(nums) -print((max_num if max_num > 0 else 0)) +tc = Counter([eval(input()) for _ in range(M)]) +ans = 0 +for s in sc.most_common(): +    k, v = s +    ans = max(ans, v - tc[k]) +print(ans)