import bisect



N = int(eval(input()))

A = list(map(int,input().split()))

assert len(A) == N

A.sort()

largest = A[-1]



acum = [0] * N

acum[0] = A[0]

for i in range(1, N):

    acum[i] = A[i] + acum[i-1]





def solve():

    unreachable = None

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

        bi = bisect.bisect(A, 2*A[i])

        if 2*acum[bi-1] < A[i+1]:

            unreachable = i

            break

    if unreachable is None:

        return N

    return N - unreachable - 1





print((solve()))
import itertools

N = int(eval(input()))

A = list(map(int,input().split()))

A.sort()

acum = list(itertools.accumulate(A))



def solve():

    unreachable = None

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

        if 2*acum[i] < A[i+1]:

            unreachable = i

            break

    if unreachable is None:

        return N

    return N - 1 - unreachable



print((solve()))
import bisect

N = int(eval(input()))
A = list(map(int, input().split()))
assert len(A) == N
A.sort()
largest = A[-1]
acum = [0] * N
acum[0] = A[0]
for i in range(1, N):
    acum[i] = A[i] + acum[i - 1]


def solve():
    unreachable = None
    for i in range(N - 2, -1, -1):
        bi = bisect.bisect(A, 2 * A[i])
        if 2 * acum[bi - 1] < A[i + 1]:
            unreachable = i
            break
    if unreachable is None:
        return N
    return N - unreachable - 1


print((solve()))

import itertools

N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
acum = list(itertools.accumulate(A))


def solve():
    unreachable = None
    for i in range(N - 2, -1, -1):
        if 2 * acum[i] < A[i + 1]:
            unreachable = i
            break
    if unreachable is None:
        return N
    return N - 1 - unreachable


print((solve()))

-import bisect +import itertools -assert len(A) == N -largest = A[-1] -acum = [0] * N -acum[0] = A[0] -for i in range(1, N): -    acum[i] = A[i] + acum[i - 1] +acum = list(itertools.accumulate(A)) -        bi = bisect.bisect(A, 2 * A[i]) -        if 2 * acum[bi - 1] < A[i + 1]: +        if 2 * acum[i] < A[i + 1]: -    return N - unreachable - 1 +    return N - 1 - unreachable