import Control.Applicative ((<$>), (<*>), (<*), (*>), (<$))
import Control.Monad
import Data.List

main :: IO ()
main = do
  solve <$> getl read <*> getl (map read . words) >>= print

solve :: Int -> [Int] -> Int
solve n as = length (f 0 (sort as))
  where
    f _ [] = []
    f s (x:xs)
      | g s (x:xs) = (x:xs)
      | otherwise = f (s + x) xs
      where
        g t (y:z:zs)
          | (t + y) * 2 >= z = g (t + y) (z:zs)
          | otherwise = False
        g t [y] = True
          

getl :: (String -> a) -> IO a
getl f = f <$> getLine
