n=int(eval(input()))

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



ok=n-1

ng=-1



while abs(ok-ng)>1:

 mid=(ok+ng)//2



 inx=mid

 bool=True

 sum_mid=sum(a[:mid+1])



 while bool and inx!=n-2:

  if sum_mid*2>=a[inx+1]:

   sum_mid+=a[inx+1]

   inx+=1

  else:

   bool=False



 if bool:

  ok=mid

 else:

  ng=mid



print((n-ok))
n=int(eval(input()))

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



ans=1

sum=a[0]

for i in range(1,n):

 if sum*2>=a[i]:

  ans+=1

 else:

  ans=1

 sum+=a[i]

print(ans)
n = int(eval(input()))
a = sorted(list(map(int, input().split())))
ok = n - 1
ng = -1
while abs(ok - ng) > 1:
    mid = (ok + ng) // 2
    inx = mid
    bool = True
    sum_mid = sum(a[: mid + 1])
    while bool and inx != n - 2:
        if sum_mid * 2 >= a[inx + 1]:
            sum_mid += a[inx + 1]
            inx += 1
        else:
            bool = False
    if bool:
        ok = mid
    else:
        ng = mid
print((n - ok))

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

-ok = n - 1 -ng = -1 -while abs(ok - ng) > 1: -    mid = (ok + ng) // 2 -    inx = mid -    bool = True -    sum_mid = sum(a[: mid + 1]) -    while bool and inx != n - 2: -        if sum_mid * 2 >= a[inx + 1]: -            sum_mid += a[inx + 1] -            inx += 1 -        else: -            bool = False -    if bool: -        ok = mid +ans = 1 +sum = a[0] +for i in range(1, n): +    if sum * 2 >= a[i]: +        ans += 1 -        ng = mid -print((n - ok)) +        ans = 1 +    sum += a[i] +print(ans)