N=int(eval(input()))

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

# そこまでの累計(の2倍)より大きければ、そこまでに現れた数字はすべてNG



sums=0

least=0

for i in range(N):

  if A[i]>sums*2:

    least=i

  sums+=A[i]

print((N-least))

import sys

readline = sys.stdin.readline



N = int(readline())

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



A = sorted(A)



cur = 0

ng = 0

for i in range(N):

  if A[i] > cur * 2:

    ng = i

  cur += A[i]

  

print((N - ng))
N = int(eval(input()))
A = sorted(list(map(int, input().split())))
# そこまでの累計(の2倍)より大きければ、そこまでに現れた数字はすべてNG
sums = 0
least = 0
for i in range(N):
    if A[i] > sums * 2:
        least = i
    sums += A[i]
print((N - least))

import sys

readline = sys.stdin.readline
N = int(readline())
A = list(map(int, readline().split()))
A = sorted(A)
cur = 0
ng = 0
for i in range(N):
    if A[i] > cur * 2:
        ng = i
    cur += A[i]
print((N - ng))

-N = int(eval(input())) -A = sorted(list(map(int, input().split()))) -# そこまでの累計(の2倍)より大きければ、そこまでに現れた数字はすべてNG -sums = 0 -least = 0 +import sys + +readline = sys.stdin.readline +N = int(readline()) +A = list(map(int, readline().split())) +A = sorted(A) +cur = 0 +ng = 0 -    if A[i] > sums * 2: -        least = i -    sums += A[i] -print((N - least)) +    if A[i] > cur * 2: +        ng = i +    cur += A[i] +print((N - ng))