module Main where
--import Debug.Trace
import Data.List
import Data.Char
import Data.Array
import Data.Maybe
import Data.Ord
import Control.Monad

solve :: [Int] -> Int
solve [] = 0
solve (x:xs)
    | isPrime x = 1 + solve xs
    | otherwise = solve xs where
        isPrime = iter (2:[3,5..])
        iter (d:ds) x
            | d*d > x = True
            | mod x d == 0 = False
            | otherwise = iter ds x

main :: IO() 
main = do
    n <- readLn
    l <- replicateM n readLn :: IO [Int]
    print (solve l)

