isPrime :: Int -> Bool
isPrime 1 = False
isPrime 2 = True
isPrime x =
  let limit = floor . sqrt $ fromIntegral x
  in  not $ any (\k -> x `mod` k == 0) [2..limit]

main = do
  _ <- getLine
  content <- getContents
  let inputs = map (read :: String -> Int) $ lines content
  putStrLn $ show . length $ filter isPrime inputs