n = int(input())
d = {}
for i in range(n):
    a=input()
    if a in d:
        d[a]+=1
    else:
        d[a]=1
m = int(input())
for i in range(m):
    a=input()
    if a in d:
        d[a]-=1
    else:
        d[a]=-1
m=max(d.values())
if m<0:
    m=0
print(m)