{-# LANGUAGE PartialTypeSignatures #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE Strict #-}
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 . L.sort

solve :: Int -> [Int] -> Int
solve _ [] = 0
solve _ [_] = 1
solve n (x:xs)
  | otherwise = let (c1,l1) = go False x xs in fromEnum c1 + solve n l1
  where
    go isSeq _ [] = if isSeq then (0,[]) else (1,[])
    go isSeq a (b:bs)
      | a==1 && b==1 = (0,[])
      | a==1 = (1,[])
      | (b `mod` a) == 0 = let (c,l) = go (a==b) a bs in (c,l)
      | otherwise = let (c,l) = go isSeq a bs in (c,b:l)

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

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