import Control.Monad
import Control.Applicative

main :: IO ()
main = getLine >>= \_ -> fmap ((map read) . lines) getContents >>= \an -> print $ solve 1 an


-- subtractor -> 
solve :: Int -> [Int] -> Int
solve _   [] = 0
solve k (a:an)
  | k <  a    = if a `mod` k == 0 && k /= 1 then 1 + solve k ((a-k-1):an) else 1 + solve k ((a-k):an)
  | k == a    = solve (k+1) an
  | otherwise = solve k an