Little girl Susie went shopping with her mom and she wondered how to improve service quality. 

There are n people in the queue. For each person we know time t_{i} needed to serve him. A person will be disappointed if the time he waits is more than the time needed to serve him. The time a person waits is the total time when all the people who stand in the queue in front of him are served. Susie thought that if we swap some people in the queue, then we can decrease the number of people who are disappointed. 

Help Susie find out what is the maximum number of not disappointed people can be achieved by swapping people in the queue.


-----Input-----

The first line contains integer n (1 ≤ n ≤ 10^5).

The next line contains n integers t_{i} (1 ≤ t_{i} ≤ 10^9), separated by spaces.


-----Output-----

Print a single number — the maximum number of not disappointed people in the queue.


-----Examples-----
Input
5
15 2 1 5 3

Output
4



-----Note-----

Value 4 is achieved at such an arrangement, for example: 1, 2, 3, 5, 15. Thus, you can make everything feel not disappointed except for the person with time 5.

Difficulty: interview

Starter code:

Solutions:
n = int(input())
a = [int(x) for x in input().split()]
a.sort()
num = 0
res = 0
for i in range(n):
    if int(a[i]) >= num:
        res += 1
        num += int(a[i])
    #print(res, a[i])
print(res)


n = int(input())

a = [int(x) for x in input().split()]
a.sort()

cur = 0
res = 0
for x in a:
    if x >= cur:
        res += 1
        cur += x

print(res)

n = int(input())
ar = list(sorted(list(map(int, input().split()))))
curr = 0
sum1 = 0
for i in range(n):
    if curr <= ar[i]:
        sum1 += 1
        curr += ar[i]
print(sum1)


n=input()
inp=[int(x) for x in input().split()]
inp.sort()
count=0
time=0
for i in inp:
	if time<=i:
		time+=i
		count+=1
print(count)


n = int(input())
A = list(map(int, input().split()))
A.sort()
time = 0
ans = 0
for i in A :
    if i >= time :
        ans += 1
        time += i
print(ans)
        


n = int(input())
a = input().split()
for i in range(n):
    a[i] = int(a[i])
a.sort()
s = 0
k = 0
for i in a:
    if i >= s:
        k += 1
        s = s + i
print(k)


N = int(input()) 
time = sorted(map(int, input().split()))
ans = 0
tsum = 0
for t in time:
    if tsum <= t:
        ans += 1
        tsum += t
print(ans)
        


a = int(input())
x = [int(x) for x in input().split()]
x.sort()
time = 0
c = 0
for i in range(a):
    if x[i] >= time:
        time += x[i]
        c += 1
print(c)

n = int(input())
serveTime = [int(x) for x in input().split()]
serveTime.sort()

answer = 0
curSum = 0
for i in range(len(serveTime)):
    if serveTime[i] >= curSum:
        curSum += serveTime[i]
        answer += 1

print(answer)


n = int(input())
ns = sorted(map(int, str.split(input())))
happy = time = 0
for n in ns:

    if time <= n:

        time += n
        happy += 1

print(happy)


n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
s = 0
c = 0
for i in range(n):
    if s <= a[i]:
        c += 1
        s += a[i]
print(c)

import math,string,itertools,fractions,heapq,collections,re,array,bisect
from itertools import chain, dropwhile, permutations, combinations
from collections import defaultdict


def main(n,s):
    s.sort()
    curr = 0
    ans = 0
    for x in s:
        if x >= curr:
           ans += 1
           curr += x
    print(ans)


def main_input(info=0):
    n = int(input())
    t = list(map(int,input().split()))
    main(n,t)

def __starting_point():
    main_input()

__starting_point()

def f(l, key):
   l = l - 1
   r = len(arr)
   while l + 1 < r:
      m = (l + r) // 2
      if arr[m] >= key:
         r = m
      else:
         l = m
   return r
n = int(input())
arr = list(map(int, input().split()))
arr.sort()
#print(*arr)
s = 0
c = 0
i = 0
while i < n:
    if arr[i] >= s:
        s += arr[i]
        i += 1
        c += 1
    else:
        i = f(i, s)
print(c)

n = int(input())

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

a = sorted(a)

total = 0
c = 0

for i in a:
	if(total <= i):
		c += 1
		total += i

print(c)

from collections import Counter
n = int(input())
a = [int(s) for s in input().split()]
c = set(a)
d = Counter(a)
res = 0
summ = 0
for i in sorted(list(c)):
    for j in range(d[i]):
        if summ <= i:
            res+=1;
            summ+=i
        else:
            break
print(res)



#!/usr/bin/env python
# -*- coding: utf-8 -*-

n = int(input())
T = sorted(list(map(int,input().split())))

total_time = 0
ans = 0
for i in range(n):
    if total_time <= T[i]:
        total_time += T[i]
        ans += 1
print(ans)



n = int(input())
t = list(map(int,input().split()))


tmp = [0]*n
cnt1 = 1
cnt2 = 0

def counting_sort(array, maxval):
    """in-place counting sort"""
    m = maxval + 1
    count = [0] * m               # init with zeros
    for a in array:
        count[a] += 1             # count occurences
    i = 0
    for a in range(m):            # emit
        for c in range(count[a]): # - emit 'count[a]' copies of 'a'
            array[i] = a
            i += 1
    return (array)
if max(t)>500000:
    t.sort()
else:
    t = counting_sort(t,max(t))
def foo(x,n):
    tmp = [0]*n
    cnt2 = 1
    for i in range(1,n):
        tmp[i] = sum(x[:i])
        if tmp[i]<=x[i]:
            cnt2+=1
    return cnt2
'''
for i in range(1,n):
    tmp[i] = sum(t[:i])
    if tmp[i]<=t[i]:
        cnt1+=1
'''
"""for i in range(1,n):
    tmp[i] = sum(x[:i])
    if tmp[i]<=x[i]:
        cnt2+=1
    else:
        if len(x[i:])>=len(x[:i]):
            if x[i]<=x[i-1]:
                print(len(x[i-1:]))
                quit()
print(cnt2)"""
#print(max(cnt1,cnt2),cnt1,cnt2)
c = 0
for i in range(n):
    if t[i]>=c:
        cnt2+=1
        c+=t[i]
    '''tmp[i] = sum(t[:i])
    if tmp[i]<=t[i]:
        cnt2+=1
    else:
        t[i] = 0'''

print(cnt2)


#!/usr/bin/env python3
# -*- coding: utf-8 -*-

n = int(input())
x = [ int(i) for i in input().split() ]

x = sorted(x)

m = 0
s = 0

for i in x:
    if s <= i:
        m += 1
        s += i

print(m)


s1 = input()
s2 = [int(i) for i in input().split()]
s2.sort()
k = 0
n = 0
for i in s2:
    if i>=k:
        n+=1
        k+=i
print(n)
        


x = int(input())
y = list(map(int, input().split(' ')))
y.sort()
s = 0
ct = 0
for i in range(x):
    if s <= y[i]:
        ct += 1
        s += y[i]

print(ct)


n = int(input())
t = list(map(int, input().split()))
n = len(t)
t.sort()
ans = 1
s = t[0]
for i in range(1,n):
    if s <= t[i]:
        ans += 1
        s += t[i]
print(ans)



n = int(input())

times = [ int(time) for time in input().split() ]
times.sort()

past = 0
ok = 0
for i in range(n):
	if past <= times[i]:
		ok += 1
		past += times[i]

print(ok)

from fileinput import *

for line in input():
    if lineno() == 1:
        [n] = list(map(int, line.split()))
    else:
        data = list(map(int, line.split()))

data.sort()
time = [0] * n

cumsum = 0
count = 0
for i in range(1, n):
    cumsum = cumsum + data[i-1]

    if cumsum > data[i]:
        time[i] = data[i]
        data[i] = 0
    else:
        time[i] = cumsum

print(n - data.count(0))


t=int(input())
A=list(map(int,input().split()))
s=0
ans=0
x=0
A.sort()
while(x<t):
    if(s<=A[x]):
        ans+=1
        s+=A[x]
    x+=1
print(ans)

n=input()
a=sorted(map(int,input().split()))
ans,time=0,0
for ii in a:
    if ii>=time:
        ans+=1
        time+=ii
print(ans)