import Data.Array.ST
import Data.List
import Control.Monad
import Control.Monad.ST

initArr :: Int-> [Int] -> ST s (STArray s Int (Int, Bool))
initArr n xs = do
  let lst = zip xs (repeat True)
  newListArray (0, n-1) lst

update :: Int -> [Int] -> (STArray s Int (Int, Bool)) -> ST s ()
update _ [] arr = return ()
update last (x:xs) arr = do
    p <-readArray arr x
    let t = fst p
    forM_ xs $ \i -> do
      e <- readArray arr i
      let a = fst e
      if a `mod` t == 0 
        then do 
          writeArray arr i (a, False) 
          if a == t
            then writeArray arr x (a, False) 
            else return ()
        else return ()
    update last xs arr

solve :: Int -> [Int] -> [Bool]
solve n xs = map snd . nub $ runST $ do 
  let tgt = sort xs
  fs <- initArr n  tgt
  update (last tgt) [0 .. n - 1] fs
  getElems fs

main = do
  x <- readLn :: IO (Int)
  es <- map read . words <$> getLine  :: IO ([Int])
  print $ length . filter id $ solve x es
