import Control.Monad (replicateM)
main = do
        n <- readLn
        nums <- replicateM n readLn
        print.length.filter isPrime $ nums

primes :: [Int]
primes = 2 : 3 : filter isPrime [5,7..]

isPrime :: Int -> Bool
isPrime n = ip n primes

ip n (p:ps)
    | p > sqrtn     = True
    | n `mod` p == 0 = False
    | otherwise      = ip n ps
    where sqrtn = floor.sqrt.fromIntegral $ n