import Data.List
import qualified Data.Vector.Unboxed as VU
import qualified Data.Vector.Unboxed.Mutable as VUM
import qualified Data.ByteString.Char8 as B
import Control.Arrow
import Control.Monad

divisibles :: [Int] -> VU.Vector Int
divisibles nums = VU.create $ do
            vec <- VUM.replicate (m + 1) 0
            forM_ nums $ \factor -> do
                alreadyMulted <- VUM.read vec factor
                VUM.modify vec (+ 1) factor
                when (alreadyMulted < 1) $ do
                forM_ [factor*2, factor*3 .. m] $ \mult -> do
                    VUM.modify vec (+ 1) mult
            return vec
        where
            m = maximum nums + 1

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