
module Main where

import Debug.Trace
import Data.List

main :: IO ()
main = do
  getLine
  s <- map read . words <$> getLine 
  --a `traceShow`
  print $ solve s

solve :: [Int] -> Int
solve s = length . parse . group $ sort s

parse :: [[Int]] -> [Int]
parse (s:ss)
  | length s > 1 = t
  | otherwise = s':t
  where
    t = parse . filter ((/= 0) . (`mod` s') . head) $ ss
    s' = head s

parse [] = []
