from sys import stdin

nii=lambda:list(map(int,stdin.readline().split()))

lnii=lambda:list(map(int,stdin.readline().split()))



n=int(eval(input()))

a=lnii()

a.sort()



b=[0]

for i in range(1,n+1):

  b.append(b[i-1]+a[i-1])

b=b[1:]



ans=1

for i in range(n-2,-1,-1):

  if b[i]*2>=a[i+1]:

    ans+=1

  else:

    break



print(ans)
from sys import stdin

nii=lambda:list(map(int,stdin.readline().split()))

lnii=lambda:list(map(int,stdin.readline().split()))



n=int(eval(input()))

a=lnii()

a.sort()



sum_v=0

ans=0

for i in range(n-1):

  sum_v+=a[i]

  if sum_v*2>=a[i+1]:

    ans+=1

  else:

    ans=0



ans+=1

print(ans)
from sys import stdin

nii = lambda: list(map(int, stdin.readline().split()))
lnii = lambda: list(map(int, stdin.readline().split()))
n = int(eval(input()))
a = lnii()
a.sort()
b = [0]
for i in range(1, n + 1):
    b.append(b[i - 1] + a[i - 1])
b = b[1:]
ans = 1
for i in range(n - 2, -1, -1):
    if b[i] * 2 >= a[i + 1]:
        ans += 1
    else:
        break
print(ans)

from sys import stdin

nii = lambda: list(map(int, stdin.readline().split()))
lnii = lambda: list(map(int, stdin.readline().split()))
n = int(eval(input()))
a = lnii()
a.sort()
sum_v = 0
ans = 0
for i in range(n - 1):
    sum_v += a[i]
    if sum_v * 2 >= a[i + 1]:
        ans += 1
    else:
        ans = 0
ans += 1
print(ans)

-b = [0] -for i in range(1, n + 1): -    b.append(b[i - 1] + a[i - 1]) -b = b[1:] -ans = 1 -for i in range(n - 2, -1, -1): -    if b[i] * 2 >= a[i + 1]: +sum_v = 0 +ans = 0 +for i in range(n - 1): +    sum_v += a[i] +    if sum_v * 2 >= a[i + 1]: -        break +        ans = 0 +ans += 1