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