import math

N = int(eval(input()))

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



left = 0

right = N

for i in range(int(math.log(N, 2)) + 10):

    center = (left + right) // 2

    B = A[:center] + A[center+1:]

    slime = A[center]



    for b in B:

        if 2*slime >= b:

            slime += b

        else:

            left = center

            break

    else:

        right = center



print((N - right))
N = int(eval(input()))

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

cumA = [0]

for a in A:

    if a > 2*cumA[-1]:

        t = A.index(a)

    cumA.append(cumA[-1] + a)

print((N-t))

import math

N = int(eval(input()))
A = sorted(list(map(int, input().split())))
left = 0
right = N
for i in range(int(math.log(N, 2)) + 10):
    center = (left + right) // 2
    B = A[:center] + A[center + 1 :]
    slime = A[center]
    for b in B:
        if 2 * slime >= b:
            slime += b
        else:
            left = center
            break
    else:
        right = center
print((N - right))

N = int(eval(input()))
A = sorted(list(map(int, input().split())))
cumA = [0]
for a in A:
    if a > 2 * cumA[-1]:
        t = A.index(a)
    cumA.append(cumA[-1] + a)
print((N - t))

-import math - -left = 0 -right = N -for i in range(int(math.log(N, 2)) + 10): -    center = (left + right) // 2 -    B = A[:center] + A[center + 1 :] -    slime = A[center] -    for b in B: -        if 2 * slime >= b: -            slime += b -        else: -            left = center -            break -    else: -        right = center -print((N - right)) +cumA = [0] +for a in A: +    if a > 2 * cumA[-1]: +        t = A.index(a) +    cumA.append(cumA[-1] + a) +print((N - t))