import           Control.Applicative
import           Control.Monad

isPrime :: Int -> Bool
isPrime n
    | n == 2 = True
    | n < 2 || even n = False
    | otherwise =
        if any (\x -> n `mod` x == 0) xs
            then False
            else True
  where
    xs = [3 .. truncate (sqrt (fromIntegral n))]

main :: IO ()
main = do
    getLine
    xs <- fmap read . lines <$> getContents :: IO [Int]
    print $ length (filter isPrime xs)

