{-# 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 . L.sortOn snd . zip [1..]

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

-- solve :: [(Int,Int)] -> Int
-- solve [_] = 0
-- solve xs = length xs

solve :: Int -> [(Int,Int)] -> Int
solve n [] = 0
solve n [_]= 1
solve n xs = go 0 xs xs
  where
    go !c [] _ = c
    go !c (y:ys) [] = go (c+1) ys xs
    go !c a@((i,y):ys) ((j,z):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 :: Int -> IO ()
output = print

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