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



a = Counter(s)

b = Counter(t)



a.subtract(b)

print((max(0,a.most_common(1)[0][1])))
n = int(eval(input()))

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

m = int(eval(input()))

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

dics = {}

for i in s:

	if i in dics:

		dics[i] += 1

	else:

		dics[i] = 1

dict = {}

for j in t:

	if j in dict:

		dict[j] += 1

	else:

		dict[j] = 1

ans = 0

for i in list(dics.keys()):

	if i in dict:

		ans = max(ans, dics[i]-dict[i])

	else:

		ans = max(ans, dics[i])

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)]
a = Counter(s)
b = Counter(t)
a.subtract(b)
print((max(0, a.most_common(1)[0][1])))

n = int(eval(input()))
s = [eval(input()) for i in range(n)]
m = int(eval(input()))
t = [eval(input()) for i in range(m)]
dics = {}
for i in s:
    if i in dics:
        dics[i] += 1
    else:
        dics[i] = 1
dict = {}
for j in t:
    if j in dict:
        dict[j] += 1
    else:
        dict[j] = 1
ans = 0
for i in list(dics.keys()):
    if i in dict:
        ans = max(ans, dics[i] - dict[i])
    else:
        ans = max(ans, dics[i])
print(ans)

-from collections import Counter - -s = [eval(input()) for _ in range(n)] +s = [eval(input()) for i in range(n)] -t = [eval(input()) for _ in range(m)] -a = Counter(s) -b = Counter(t) -a.subtract(b) -print((max(0, a.most_common(1)[0][1]))) +t = [eval(input()) for i in range(m)] +dics = {} +for i in s: +    if i in dics: +        dics[i] += 1 +    else: +        dics[i] = 1 +dict = {} +for j in t: +    if j in dict: +        dict[j] += 1 +    else: +        dict[j] = 1 +ans = 0 +for i in list(dics.keys()): +    if i in dict: +        ans = max(ans, dics[i] - dict[i]) +    else: +        ans = max(ans, dics[i]) +print(ans)