main = do
    fs <- getLine
    ss <- getContents
    let ns = map (\x -> read x :: Int) $ words ss
    putStrLn $ show $ length $ filter isPrime ns

isPrime :: Int -> Bool
isPrime n = isNoDivisor n [2..nm]
  where
    nm = floor $ (fromIntegral n) ** (1/2)
    isNoDivisor x ys = and $ map (\y -> x `mod` y /= 0) ys

