import sys

input = sys.stdin.readline



N = int(eval(input()))

A = [int(x) for x in input().split()]



A.sort()

total = sum(A)



def test(i):

    # i番の色の人が最大になれる

    size = sum(A[:i+1])

    for x in A[i+1:]:

        if size*2 >= x:

            size += x

        else:

            break

    return size == total



left = -1 # 最大になれない

right = N-1 # 最大になれる

while right > left + 1:

    mid = (left + right)//2

    if test(mid):

        right = mid

    else:

        left = mid



answer = N-right

print(answer)
import sys

import numpy as np



read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines



A = np.array(read().split(), np.int64)[1:]



A.sort()

Acum = A.cumsum()



ng = Acum[:-1] * 2 < A[1:]

ng = np.logical_or.accumulate(ng[::-1])[::-1]

x = (~ng).sum() + 1

print(x)
import sys

input = sys.stdin.readline
N = int(eval(input()))
A = [int(x) for x in input().split()]
A.sort()
total = sum(A)


def test(i):
    # i番の色の人が最大になれる
    size = sum(A[: i + 1])
    for x in A[i + 1 :]:
        if size * 2 >= x:
            size += x
        else:
            break
    return size == total


left = -1  # 最大になれない
right = N - 1  # 最大になれる
while right > left + 1:
    mid = (left + right) // 2
    if test(mid):
        right = mid
    else:
        left = mid
answer = N - right
print(answer)

import sys
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
A = np.array(read().split(), np.int64)[1:]
A.sort()
Acum = A.cumsum()
ng = Acum[:-1] * 2 < A[1:]
ng = np.logical_or.accumulate(ng[::-1])[::-1]
x = (~ng).sum() + 1
print(x)

+import numpy as np -input = sys.stdin.readline -N = int(eval(input())) -A = [int(x) for x in input().split()] +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines +A = np.array(read().split(), np.int64)[1:] -total = sum(A) - - -def test(i): -    # i番の色の人が最大になれる -    size = sum(A[: i + 1]) -    for x in A[i + 1 :]: -        if size * 2 >= x: -            size += x -        else: -            break -    return size == total - - -left = -1  # 最大になれない -right = N - 1  # 最大になれる -while right > left + 1: -    mid = (left + right) // 2 -    if test(mid): -        right = mid -    else: -        left = mid -answer = N - right -print(answer) +Acum = A.cumsum() +ng = Acum[:-1] * 2 < A[1:] +ng = np.logical_or.accumulate(ng[::-1])[::-1] +x = (~ng).sum() + 1 +print(x)