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 $ sieve $ group $ sort as

sieve [] = []
sieve ((a:as):ass) = if null as then a : rest else rest
  where rest = sieve $ sv (a+a) a ass

sv _ _ [] = []
sv m b asss@((a:as):ass) =
  case compare m a of
    LT -> sv (m+b) b asss
    EQ -> sv (m+b) b ass
    GT -> (a:as) : sv m b ass
