
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 = (\a -> a `traceShow` length a). parse mx . group $ s'
solve s = length . parse mx . group $ s'
  where
    s' = sort s
    mx = last s'

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

parse _ [] = []
