import sys

stdin = sys.stdin



def li(): return [int(x) for x in stdin.readline().split()]

def li_(): return [int(x)-1 for x in stdin.readline().split()]

def lf(): return [float(x) for x in stdin.readline().split()]

def ls(): return stdin.readline().split()

def ns(): return stdin.readline().rstrip()

def lc(): return list(ns())

def ni(): return int(ns())

def nf(): return float(ns())



from itertools import accumulate



n = ni()

a = li()



a.sort()

a_cum = list(accumulate(a))[::-1]

a.sort(reverse=True)



ans = n



for i in range(n-1):

    if a[i] <= 2*a_cum[i+1]:

        continue

    else:

        ans = i+1

        break

        

print(ans)
import sys

stdin = sys.stdin

 

sys.setrecursionlimit(10**5) 

 

def li(): return list(map(int, stdin.readline().split()))

def li_(): return [int(x)-1 for x in stdin.readline().split()]

def lf(): return list(map(float, stdin.readline().split()))

def ls(): return stdin.readline().split()

def ns(): return stdin.readline().rstrip()

def lc(): return list(ns())

def ni(): return int(stdin.readline())

def nf(): return float(stdin.readline())



from itertools import accumulate



n = ni()

a = list(li())

a.sort()

acc = list(accumulate(a))







ans = 0

for ai, acci in zip(a[-1:0:-1], acc[-2::-1]):

    if 2*acci >= ai:

        ans += 1

    else:

        break

        

        

print((ans+1))
import sys

stdin = sys.stdin


def li():
    return [int(x) for x in stdin.readline().split()]


def li_():
    return [int(x) - 1 for x in stdin.readline().split()]


def lf():
    return [float(x) for x in stdin.readline().split()]


def ls():
    return stdin.readline().split()


def ns():
    return stdin.readline().rstrip()


def lc():
    return list(ns())


def ni():
    return int(ns())


def nf():
    return float(ns())


from itertools import accumulate

n = ni()
a = li()
a.sort()
a_cum = list(accumulate(a))[::-1]
a.sort(reverse=True)
ans = n
for i in range(n - 1):
    if a[i] <= 2 * a_cum[i + 1]:
        continue
    else:
        ans = i + 1
        break
print(ans)

import sys

stdin = sys.stdin
sys.setrecursionlimit(10**5)


def li():
    return list(map(int, stdin.readline().split()))


def li_():
    return [int(x) - 1 for x in stdin.readline().split()]


def lf():
    return list(map(float, stdin.readline().split()))


def ls():
    return stdin.readline().split()


def ns():
    return stdin.readline().rstrip()


def lc():
    return list(ns())


def ni():
    return int(stdin.readline())


def nf():
    return float(stdin.readline())


from itertools import accumulate

n = ni()
a = list(li())
a.sort()
acc = list(accumulate(a))
ans = 0
for ai, acci in zip(a[-1:0:-1], acc[-2::-1]):
    if 2 * acci >= ai:
        ans += 1
    else:
        break
print((ans + 1))

+sys.setrecursionlimit(10**5) -    return [int(x) for x in stdin.readline().split()] +    return list(map(int, stdin.readline().split())) -    return [float(x) for x in stdin.readline().split()] +    return list(map(float, stdin.readline().split())) -    return int(ns()) +    return int(stdin.readline()) -    return float(ns()) +    return float(stdin.readline()) -a = li() +a = list(li()) -a_cum = list(accumulate(a))[::-1] -a.sort(reverse=True) -ans = n -for i in range(n - 1): -    if a[i] <= 2 * a_cum[i + 1]: -        continue +acc = list(accumulate(a)) +ans = 0 +for ai, acci in zip(a[-1:0:-1], acc[-2::-1]): +    if 2 * acci >= ai: +        ans += 1 -        ans = i + 1 -print(ans) +print((ans + 1))