import Control.Monad

main = do
  n1 <- read <$> getLine
  xs <- forM [1..n1] $ \t ->
    getLine
  n2 <- read <$> getLine
  ys <- forM [1..n2] $ \t ->
    getLine
  putStrLn . show $ solve xs ys

solve :: [String] -> [String] -> Int
solve xs ys =
  let a = rmDup (xs ++ ys)
  in max 0 $ maximum $ map (\x -> length (filter (== x) xs) - length (filter (== x) ys)) a

rmDup :: Eq a => [a] -> [a]
rmDup xs = inRD [] xs
  where
    inRD ys [] = ys
    inRD ys (x:xs) = if x `elem` ys then inRD ys xs else inRD (x:ys) xs
