module Main where

import Control.Applicative
import Control.Monad
import Data.Function

is_prime :: Int -> Bool
is_prime 1 = False
is_prime 2 = True
is_prime num = try 2
    where 
        root = ceiling $ sqrt $ fromIntegral num
        try :: Int -> Bool
        try x
            | x > root         = True
            | (mod num x) == 0 = False
            | otherwise        = try $ x + 1

loop :: Int -> Int -> IO Int
loop 0 count = pure count
loop times count = do
    n <- read <$> getLine
    newCount <- pure $ if is_prime n
        then count + 1
        else count
    loop (times - 1) newCount

main = do
    times <- read <$> getLine
    count <- loop times 0
    print count

