{-# LANGUAGE PartialTypeSignatures #-}
{-# LANGUAGE BangPatterns #-}
module Main (main) where

import qualified Data.ByteString.Char8 as C8
import qualified Data.Char as C
import qualified Data.List as L

main :: IO ()
main = do
  [n] <- readInts
  readInts >>= output . solve n . g . flip zip [1..] . L.sort

g :: [(Int,Int)] -> [(Int,Int)]
g [] = []
g [_] = []
g ((x,idx):xs) = (x,idx) : g (filter (\(y,_) -> (y `mod` x /= 0)) xs)

solve :: Int -> [(Int,Int)] -> _
solve n [] = 0
solve n xs = go 0 xs xs
  where
    go !c [] _ = c
    go !c (y:ys) [] = go (c+1) ys xs
    go !c a@((y,i):ys) ((z,j):zs) =
      if i == j
        then go c a zs
        else if y `mod` z == 0
              then go c ys xs
              else go c a zs

output :: _ -> IO ()
output = print

-- utils
readInts :: IO [Int]
readInts = L.unfoldr (C8.readInt . C8.dropWhile C.isSpace) <$> C8.getLine