{-# OPTIONS_GHC -O2 #-}
import Data.List
toInt::String->Int
toInt = read
isPrime::Int->Bool
isPrime 1 = False
isPrime 2 = True
isPrime 3 = True
isPrime n = foldr (\x y->mod n x /= 0 && y) True (2:[3,5..m])
  where
    m = ((\x->if odd x then x else x-1).floor.sqrt.fromIntegral) n
primeNum::[] Int->Int
primeNum [] = 0
primeNum (x:xs) = (if isPrime x then 1 else 0) + primeNum xs
main = do
  getLine
  getContents >>=
    print.primeNum.(map toInt).lines
