module Main where

import qualified Data.Map as Map
import Control.Monad

main :: IO ()
main = do
    n <- read <$> getLine
    s <- replicateM n getLine
    m <- read <$> getLine
    t <- replicateM m getLine
    print $ solve s t

solve :: [String] -> [String] -> Int
solve s t =
    let l = ((\x -> (x, 1)) <$> s) ++ ((\x -> (x, -1)) <$> t)
        m = Map.fromListWith (+) l
    in  Map.foldr (+) 0 $ Map.filter (>0) m