import copy



N = int(eval(input()))

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

A.sort()

cum_A = copy.copy(A)



for i in range(N-1):

  cum_A[i+1] += cum_A[i]

#print(cum_A)

t = 0

for i in range(N-1, 0, -1):

  if A[i] <= 2 * cum_A[i-1]:

    t = i-1

  else:

    break

 

print((N-t))

        
N = int(eval(input()))



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



A.sort()



memo = [0]*N



for i in range(N):

    memo[i] = memo[i-1]+A[i]



for i in range(N-1,0,-1):

    if A[i] <= 2 * memo[i-1]:

        ans = i-1

    else:

        break

print((N-ans))
import copy

N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
cum_A = copy.copy(A)
for i in range(N - 1):
    cum_A[i + 1] += cum_A[i]
# print(cum_A)
t = 0
for i in range(N - 1, 0, -1):
    if A[i] <= 2 * cum_A[i - 1]:
        t = i - 1
    else:
        break
print((N - t))

N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
memo = [0] * N
for i in range(N):
    memo[i] = memo[i - 1] + A[i]
for i in range(N - 1, 0, -1):
    if A[i] <= 2 * memo[i - 1]:
        ans = i - 1
    else:
        break
print((N - ans))

-import copy - -cum_A = copy.copy(A) -for i in range(N - 1): -    cum_A[i + 1] += cum_A[i] -# print(cum_A) -t = 0 +memo = [0] * N +for i in range(N): +    memo[i] = memo[i - 1] + A[i] -    if A[i] <= 2 * cum_A[i - 1]: -        t = i - 1 +    if A[i] <= 2 * memo[i - 1]: +        ans = i - 1 -print((N - t)) +print((N - ans))