import Control.Monad

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

solve :: [Int] -> Int
solve = length . filter isPrime
  where
    isPrime :: Int -> Bool
    isPrime n = all ((/= 0) . (n `mod` ))
                $ takeWhile ((<= n) . (^2)) [2..]