import qualified Data.Map as M

main :: IO ()
main = do
  n <- readLn
  ss <- sequence $ replicate n getLine
  m <- readLn
  ts <- sequence $ replicate m getLine
  print $ solve ss ts

solve :: [String] -> [String] -> Int
solve ss ts = go (M.singleton "" 0) ss ts
  where
    go dict [] []     = maximum $ M.elems dict
    go dict (s:ss) ts = go (M.insertWith (+) s 1 dict) ss ts
    go dict [] (t:ts) = go (M.insertWith (+) t (-1) dict) [] ts