import Control.Applicative
import Control.Monad
import Data.List
strToInt s = (read :: String -> Int) s
main = do
    n <- strToInt <$> 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 n]
    print a
{-
qsort :: (Ord a) => [a] -> [a]
qsort [] = []
qsort (x:xs) = small ++ [x] ++ large
    where   small = [s | s <- xs, x > s]
            large = [l | l <- xs, x < l]
-}
binarysearch :: [Int] -> Int -> Int -> Bool
binarysearch [] _ 0 = False
binarysearch [x] n 1 = x == n
binarysearch xs n l
        | n == p = True
        | n <  p = binarysearch (take (m-1) xs) n (m-1)
        | otherwise = binarysearch (drop m xs) n (l-m)
        where   m = l `div` 2
                p = xs !! (m-1)