import Data.List
import qualified Data.Vector.Unboxed as VU
import qualified Data.ByteString.Char8 as B
import Control.Arrow
import Data.Array.ST
import Data.Array
import Control.Monad

divisibles numArray = runSTArray (do
        {
            a <- newArray (0, m + 1) 0;
            sequence [writeArray a x 2 | x <- nums, x `elem` nums];
            forM_ nums (\i -> do
                sequence [writeArray a x 0 | x <- nums, x > i && x `mod` i == 0]);
            forM_ nums (\i -> do
                p <- readArray a i
                sequence [writeArray a i (p - 1) | x <- nums, x <= i, x == i]);
            return a
        })
        where
            n = length nums
            m = maximum nums
            nums = sort $ VU.toList numArray

main = do
  let readInt = fmap (second B.tail) . B.readInt
  [n] <- map read . words <$> getLine
  ps <- VU.unfoldrN n readInt <$> B.getLine
  let ans = divisibles ps
--   putStrLn $ show ans
  let asnss = filter (\x -> x > 0) $ elems ans
  putStrLn $ show $ length asnss
