import copy

n=int(eval(input()))

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

B=copy.deepcopy(A)

for i in range(1,n):

    B[i]=B[i]+B[i-1]



cnt=1

for i in reversed(list(range(n-1))):

    if B[i]*2>=A[i+1]:

        cnt +=1

    else:break

print(cnt)
n=int(eval(input()))

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

sum_A=sum(A)

cnt=1

for i in reversed(list(range(n))):

    sum_A -=A[i]

    if sum_A*2>=A[i]:

        cnt +=1

    else:break

print(cnt)
import copy

n = int(eval(input()))
A = sorted(list(map(int, input().split())))
B = copy.deepcopy(A)
for i in range(1, n):
    B[i] = B[i] + B[i - 1]
cnt = 1
for i in reversed(list(range(n - 1))):
    if B[i] * 2 >= A[i + 1]:
        cnt += 1
    else:
        break
print(cnt)

n = int(eval(input()))
A = sorted(list(map(int, input().split())))
sum_A = sum(A)
cnt = 1
for i in reversed(list(range(n))):
    sum_A -= A[i]
    if sum_A * 2 >= A[i]:
        cnt += 1
    else:
        break
print(cnt)

-import copy - -B = copy.deepcopy(A) -for i in range(1, n): -    B[i] = B[i] + B[i - 1] +sum_A = sum(A) -for i in reversed(list(range(n - 1))): -    if B[i] * 2 >= A[i + 1]: +for i in reversed(list(range(n))): +    sum_A -= A[i] +    if sum_A * 2 >= A[i]: