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 $ sort s

parse :: [Int] -> [Int]
parse s@(s1:s2:ss)
  | s1 == s2  = t
  | otherwise = s1:t
  where
    t = parse . filter ((/= 0) . (`mod` s1)) $ s

parse [s] = [s]
parse [] = []
