{-#LANGUAGE BangPatterns#-}
import Data.Functor
import Control.Monad

main::IO ()
main=
  do
    n <- read <$> getLine::IO Int
    numList <- replicateM n (read <$> getLine)::IO [Int]
    let output=length . filter isPrime $ numList
    print output

isPrime::Integral a=>a->Bool
isPrime n=isPrime' n 2
  where
    isPrime' !a !x
      |floor (sqrt (fromIntegral a)) < x =True
      |otherwise =
        case a `mod` x of
          0->False
          _->isPrime' a (x+1)