import Control.Monad
import Control.Applicative
import Data.List
maxl [x] = x
maxl (x:xs) = let d = maxl xs
             in
             if x > d then x else d
count t [] = 0
count t (x:xs) = if t == x then
                    1 + count t xs
                 else
                        count t xs
main = do
        n <- read <$> getLine
        s <- replicateM n getLine
        m <- read <$> getLine
        t <- replicateM m getLine
        let d = [(count x s) - (count x t) | x <- (s++t)]
        print $ if maxl d >= 0 then maxl d else 0