import qualified Data.ByteString.Char8 as BS
import Data.Maybe
import Data.Ord
import Data.List
import qualified Data.Set as Set

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words

getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine


ordNub :: (Ord a) => [a] -> [a]
ordNub l = go Set.empty l
  where
    go _ []     = []
    go s (x:xs) = if x `Set.member` s then go s xs
                                      else x : go (Set.insert x s) xs

cc :: Int -> [Int] -> Int
cc x [] = 1
cc x (y:ys) | x == y = cc x ys
            | x `mod` y /= 0 = cc x ys
            | otherwise = 0

calc :: [Int] -> [Int] -> [Int]
calc [] xs' = []
calc (x:xs) xs' | cc x xs' == 1 = x : calc xs xs'
                | otherwise = calc xs xs'

main = do
  n <- getInt
  as <- getIntList
  let as' = ordNub as
  let ds = as \\ as'
  if length as' == 0
    then print 0
    else do
      let rs = calc as' as'
      print $ length(filter (\x -> x `notElem` ds) rs)
