N=io.read()
s={}
count={}
for i=1,N do
  s[i]=io.read()
  count[s[i]]=(count[s[i]] or 0) +1
end
M=io.read()
t={}
for i=1,M do
  t[i]=io.read()
  count[t[i]]=(count[t[i]] or 0) -1
end
local earn=0
for _,v in pairs(count) do
  if v>earn then
    earn=v
  end
end
print(earn)
