-- -- Getting Started - Prime Numbers

import Control.Applicative
import Control.Monad

main :: IO ()
main = do
  n  <- readLn
  xs <- map read <$> replicateM n getLine
  print $ length $ filter isPrime xs

isPrime :: Integral a => a -> Bool
isPrime n = n > 1 && foldr f True divs
  where
    divs = 2 : 3 : concat [[x - 1, x + 1] | x <- [6, 12 ..]]
    f p b = (p * p > n) || (rem n p /= 0 && b)

