import Control.Applicative
import Control.Monad
import Data.List
strToInt s = (read :: String -> Int) s
main = do
    n <- getLine
    s <- map read . words <$> getLine
    q <- getLine
    t <- map read . words <$> getLine
    let s' = nub s
    let a = sum [1 | x <- t, binarysearch s' x]
    print a

binarysearch :: [Int] -> Int -> Bool
binarysearch [] _ = False
binarysearch [x] n = x == n
binarysearch xs n
        | n == p = True
        | n <  p = binarysearch (take (m-1) xs) n
        | otherwise = binarysearch (drop m xs) n
        where   m = l `div` 2
                p = xs !! (m-1)