import Control.Monad

main = do
  n <- readLn :: IO Int
  s <- replicateM n getLine
  m <- readLn :: IO Int
  t <- replicateM m getLine

  print $ maximum [length (filter (==a) s) - length (filter (==a) t) | a <- s]
