n=int(eval(input()))

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

A.sort()

S=[]

s=0

for i in range(n):

    s+=A[i]

    S.append(s)

ans=1

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

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

        ans+=1

    else:

        break

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

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

A.sort()

ans=1

s=0

for i in range(n):

    if 2*s>=A[i]:

        ans+=1

    else:

        ans=1

    s+=A[i]

print(ans)
n = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
S = []
s = 0
for i in range(n):
    s += A[i]
    S.append(s)
ans = 1
for i in reversed(list(range(n - 1))):
    if S[i] * 2 >= A[i + 1]:
        ans += 1
    else:
        break
print(ans)

n = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
ans = 1
s = 0
for i in range(n):
    if 2 * s >= A[i]:
        ans += 1
    else:
        ans = 1
    s += A[i]
print(ans)

-S = [] +ans = 1 -    s += A[i] -    S.append(s) -ans = 1 -for i in reversed(list(range(n - 1))): -    if S[i] * 2 >= A[i + 1]: +    if 2 * s >= A[i]: -        break +        ans = 1 +    s += A[i]