import           Control.Monad
import           Data.Maybe
import qualified Data.ByteString.Char8 as BS
import qualified Data.Sequence as Seq
import Data.Foldable

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
  n <- getInt
  as <- (Seq.unstableSortBy (flip compare) . Seq.fromList) <$> getIntList

  let bgst = Seq.index as 0
      th = (bgst + 1) `div` 2

      bigs = Seq.takeWhileL (>= th) as
      smalls = Seq.dropWhileL (>= th) as

      _ Seq.:> x = Seq.viewr bigs

      countSmallWinners x xs s res | s*2 < x   = res
                                   | otherwise = countSmallWinners x' xs' s' res'
        where x' Seq.:< xs' = Seq.viewl xs
              s' = s - x'
              res' = res + 1

      ans = Seq.length bigs + countSmallWinners x smalls (sum smalls) 0

  print ans