module Main where

import Data.Functor
import Data.Bool

main :: IO ()
main = do
  { [n] <- getInts
  ; print =<< loop 0 n
  }

loop :: Int -> Int -> IO Int
loop c 0 = return c
loop c n = do
  { [m] <- getInts
  ; loop (bool c (c+1) (isPrime m)) (n-1)
  }

getInts :: IO [Int]
getInts = map read . words <$> getLine

isPrime :: Int -> Bool
isPrime k = null [x | x <- [2..isqrt k], k `mod` x == 0]

isqrt :: Int -> Int
isqrt = floor . sqrt . fromIntegral