N=int(eval(input()))

A=[0]+sorted(map(int,input().split()))

l=0

r=N

while l+1<r:

    i = (l+r)//2

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

    for j in range(i+1,N):

        if a*2<A[j]: l = i;break

        a += A[j]

    else:

        r = i

print((N-r+1))
#二分探索

N = int(eval(input()))

A = [0] + sorted(map(int,input().split()))



def check(i):

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

    for b in A[i+1:]:

        if a*2>=b:

            a += b

        else:return False

    return True



l = 0

r = N

while l+1<r:

    i = (l+r)//2

    if check(i):

        r = i

    else:

        l = i



print((N-l))
N = int(eval(input()))
A = [0] + sorted(map(int, input().split()))
l = 0
r = N
while l + 1 < r:
    i = (l + r) // 2
    a = sum(A[: i + 1])
    for j in range(i + 1, N):
        if a * 2 < A[j]:
            l = i
            break
        a += A[j]
    else:
        r = i
print((N - r + 1))

# 二分探索
N = int(eval(input()))
A = [0] + sorted(map(int, input().split()))


def check(i):
    a = sum(A[: i + 1])
    for b in A[i + 1 :]:
        if a * 2 >= b:
            a += b
        else:
            return False
    return True


l = 0
r = N
while l + 1 < r:
    i = (l + r) // 2
    if check(i):
        r = i
    else:
        l = i
print((N - l))

+# 二分探索 + + +def check(i): +    a = sum(A[: i + 1]) +    for b in A[i + 1 :]: +        if a * 2 >= b: +            a += b +        else: +            return False +    return True + + -    a = sum(A[: i + 1]) -    for j in range(i + 1, N): -        if a * 2 < A[j]: -            l = i -            break -        a += A[j] +    if check(i): +        r = i -        r = i -print((N - r + 1)) +        l = i +print((N - l))