from collections import Counter

N = int(eval(input()))

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

M = int(eval(input()))

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



#print(Counter(s))

cs = Counter(s)

ct = Counter(t)

for i in cs:

    #print(i,cs[i])

    for j in ct:

        #print(j,ct[j])

        if i == j:

            cs[i]=cs[i]-ct[j]

            

#print(cs)

print((max(0,cs.most_common(1)[0][1])))

    
N = int(eval(input()))

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

M = int(eval(input()))

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



l = list(set(s))





mx  = max(s.count(l[i])-t.count(l[i]) for i in range(len(l)))

print((max(0,mx)))
from collections import Counter

N = int(eval(input()))
s = [str(eval(input())) for _ in range(N)]
M = int(eval(input()))
t = [str(eval(input())) for _ in range(M)]
# print(Counter(s))
cs = Counter(s)
ct = Counter(t)
for i in cs:
    # print(i,cs[i])
    for j in ct:
        # print(j,ct[j])
        if i == j:
            cs[i] = cs[i] - ct[j]
# print(cs)
print((max(0, cs.most_common(1)[0][1])))

N = int(eval(input()))
s = [str(eval(input())) for _ in range(N)]
M = int(eval(input()))
t = [str(eval(input())) for _ in range(M)]
l = list(set(s))
mx = max(s.count(l[i]) - t.count(l[i]) for i in range(len(l)))
print((max(0, mx)))

-from collections import Counter - -# print(Counter(s)) -cs = Counter(s) -ct = Counter(t) -for i in cs: -    # print(i,cs[i]) -    for j in ct: -        # print(j,ct[j]) -        if i == j: -            cs[i] = cs[i] - ct[j] -# print(cs) -print((max(0, cs.most_common(1)[0][1]))) +l = list(set(s)) +mx = max(s.count(l[i]) - t.count(l[i]) for i in range(len(l))) +print((max(0, mx)))