import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS
import Data.List

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
    n <- getInt
    as <- sort <$> getIntList
    print $ solve 0 as

solve k [] = k
solve k (a:as) = solve k' (filter ((/= 0) . (`mod` a)) as)
    where k' = if a `elem` as then k else k+1