import Control.Applicative
import Control.Monad
import Data.List

isPrime 1 = False
isPrime 2 = True
isPrime 3 = True
isPrime n = all ((/=0).mod n) [2..(truncate.sqrt.fromIntegral) n]

main = do 
    n <- readLn ::IO Int
    q <- replicateM n readLn ::IO[Int]
    putStrLn $ show((length.filter(id)) (map isPrime q))