import Control.Monad
import Data.List
main = do
  n <- readLn
  s <- replicateM n getLine
  m <- readLn
  t <- replicateM m getLine
  print $ max 0 (maximum (map (f s t) (nub (s++t))))
  
f xs ys z = length (filter (== z) xs) - length (filter (== z) ys)
