import qualified Data.ByteString.Char8 as BS
import Data.Char
import Data.List

main = do
  li <- BS.getLine
  let Just (n,_) = BS.readInt li
  li <- BS.getLine
  let as = unfoldr (BS.readInt . BS.dropWhile isSpace) li
  let ans = compute n as
  print ans

compute :: Int -> [Int] -> Int
compute n as = length $ loop [] as

loop _ [] = []
loop bs (a:as)
  | b    = () : rest
  | True =      rest
  where
    b = all ((0 /=).(mod a)) (bs ++ as)
    rest = loop (a:bs) as