isPrime :: Int -> Bool
isPrime x
    | x < 2     = False
    | x == 2    = True
    | even x    = False
    | otherwise = all (\y -> x `mod` y /= 0) [3, 5 .. n]
        where n = floor $ sqrt $ fromIntegral x

solve :: [Int] -> Int
solve xs = length $ filter isPrime xs

main :: IO ()
main = interact (show . solve . map read . lines)