n=io.read("*n","*l")
s={}
for i=1,n do
    x=io.read()
    if not s[x] then
        s[x]=1
    else
        s[x]=s[x]+1
    end
end
m=io.read("*n","*l")
t={}
for i=1,m do
    x=io.read()
    if not t[x] then
        t[x]=1
    else
        t[x]=t[x]+1
    end
end

yen=0
for k,v in pairs(s) do
    if t[k] then
        x=t[k]
    else
        x=0
    end
    yen=math.max(yen,s[k]-x)
end
print(yen)