isprime :: Int -> Bool
isprime 1 = False
isprime 2 = True
isprime n = not $ or (map ((0==).(mod n)) [2..(n-1)])

getNLines :: Int -> IO [String]
getNLines n = do
    ans <- sequence $ take n (repeat getLine)
    return ans

main = do
    n <- getLine >>= return . read
    numbers <- getNLines n
    let integers = map read numbers
    print $ foldl (\acc x -> if isprime x then acc+1 else acc) 0 integers 


