{-# LANGUAGE TypeApplications #-}

import Control.Monad

main = do
    n <- readLn @ Int
    xs <- replicateM n getLine
    m <- readLn @ Int
    ys <- replicateM m getLine

    print $ (foldl max 0 . fmap (\x -> ((length . filter (== x)) xs) - ((length . filter (== x)) ys))) xs
