import Control.Monad

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

  print $ maximum $ map (\x -> if x<0 then 0 else x) [length (filter (==a) s) - length (filter (==a) t) | a <- s]
