N=int(input())
s = [input() for i in range(N)]
M=int(input())
t = [input() for i in range(M)]
tmp=[0]
for i in range(N):
    point=0
    point+=s.count(s[i])
    point-=t.count(s[i])
    tmp.append(point)
print(max(tmp))