import qualified Data.ByteString.Char8 as BS
import Data.Char
import Data.List

main = do
  li <- BS.getLine
  let Just (n,_) = BS.readInt li
  li <- BS.getLine
  let as = unfoldr (BS.readInt . BS.dropWhile isSpace) li
  let ans = compute n as
  print ans

-- 整列して、複数あるものは問題外。自分と同じ値で割り切れる。
-- 自分より大きい値は気にしなくていい。より小さい値だけが問題。
-- そこに、自分を割り切る数がなければセーフ。
-- セーフな値だけを、今後試せば十分。
compute :: Int -> [Int] -> Int
compute n as = length $ loop [] $ group $ sort as

loop _ [] = []
loop bs ([a]:as)
  | f    = () : loop (a:bs) as
  | True =      loop    bs  as
  where
    f = all ((0 /=).(mod a)) bs
loop bs ((a:_):as) = loop (a:bs) as