{-# LANGUAGE OverloadedLists     #-}
{-# LANGUAGE OverloadedStrings   #-}
{-# LANGUAGE ScopedTypeVariables #-}

import           Control.Monad
import           Data.IORef
import           Data.Maybe
import qualified Data.Text     as T
import qualified Data.Text.IO  as T
import           GHC.Base
import           System.IO

import qualified Data.Array    as A
import qualified Data.IntMap   as I
import qualified Data.Map      as M
import qualified Data.Set      as S
import qualified Data.Vector   as V

readT :: Read a => T.Text -> a
readT = read . T.unpack

getLineSpc :: Read a => IO [a]
getLineSpc = do
  t <- T.getLine
  let xs = map readT $ T.split (== ' ') t
  return xs

getLineSpcVec :: Read a => IO (V.Vector a)
getLineSpcVec = do
  t <- T.getLine
  let xs = V.fromList $ map readT $ T.split (== ' ') t
  return xs

main :: IO ()
main = twoColorsCardGame

twoColorsCardGame :: IO ()
twoColorsCardGame = do
  n :: Int             <- readLn
  s :: V.Vector T.Text <- V.replicateM n T.getLine
  m :: Int             <- readLn
  t :: V.Vector T.Text <- V.replicateM m T.getLine
  vec <- newIORef [0]
  forM_ s $ \si -> do
    let diff = same si s - same si t
    modifyIORef vec (`V.snoc` diff)
  print =<< V.maximum <$> readIORef vec
  where
    same e vec = V.length $ V.filter (== e) vec