Imagine that you have a twin brother or sister. Having another person that looks exactly like you seems very unusual. It's hard to say if having something of an alter ego is good or bad. And if you do have a twin, then you very well know what it's like.

Now let's imagine a typical morning in your family. You haven't woken up yet, and Mom is already going to work. She has been so hasty that she has nearly forgotten to leave the two of her darling children some money to buy lunches in the school cafeteria. She fished in the purse and found some number of coins, or to be exact, *n* coins of arbitrary values *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub>. But as Mom was running out of time, she didn't split the coins for you two. So she scribbled a note asking you to split the money equally.

As you woke up, you found Mom's coins and read her note. "But why split the money equally?" — you thought. After all, your twin is sleeping and he won't know anything. So you decided to act like that: pick for yourself some subset of coins so that the sum of values of your coins is strictly larger than the sum of values of the remaining coins that your twin will have. However, you correctly thought that if you take too many coins, the twin will suspect the deception. So, you've decided to stick to the following strategy to avoid suspicions: you take the minimum number of coins, whose sum of values is strictly more than the sum of values of the remaining coins. On this basis, determine what minimum number of coins you need to take to divide them in the described manner.
The first line contains integer *n* (1 ≤ *n* ≤ 100) — the number of coins. The second line contains a sequence of *n* integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 100) — the coins' values. All numbers are separated with spaces.
2
3 3
2
3
2 1 2
2
1
5
1
5
4 2 2 2 2
3
7
1 10 1 2 1 1 1
1
5
3 2 3 3 1
3
2
2 1
1
3
2 1 3
2
6
1 1 1 1 1 1
4
7
10 10 5 5 5 5 1
3
20
2 1 2 2 2 1 1 2 1 2 2 1 1 1 1 2 1 1 1 1
8
20
4 2 4 4 3 4 2 2 4 2 3 1 1 2 2 3 3 3 1 4
8
20
35 26 41 40 45 46 22 26 39 23 11 15 47 42 18 15 27 10 45 40
8
20
7 84 100 10 31 35 41 2 63 44 57 4 63 11 23 49 98 71 16 90
6
50
19 2 12 26 17 27 10 26 17 17 5 24 11 15 3 9 16 18 19 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100
3 4 8 10 8 6 4 3 7 7 6 2 3 1 3 10 1 7 9 3 5 5 2 6 2 9 1 7 4 2 4 1 6 1 7 10 2 5 3 7 6 4 6 2 8 8 8 6 6 10 3 7 4 3 4 1 7 9 3 6 3 6 1 4 9 3 8 1 10 1 4 10 7 7 9 5 3 8 10 2 1 10 8 7 10 8 5 3 1 2 1 10 6 1 5 3 3 5 7 2
30
100
16 9 11 8 11 4 9 17 4 8 4 10 9 10 6 3 3 15 1 6 1 15 12 18 6 14 13 18 1 7 18 4 10 7 10 12 3 16 14 4 10 8 10 7 19 13 15 1 4 8 16 10 6 4 3 16 11 10 7 3 4 16 1 20 1 11 4 16 10 7 7 12 18 19 3 17 19 3 4 19 2 12 11 3 18 20 2 2 14 4 20 13 13 11 16 20 19 14 7 2
29
100
2 46 4 6 38 19 15 34 10 35 37 30 3 25 5 45 40 45 33 31 6 20 10 44 11 9 2 14 35 5 9 23 20 2 48 22 25 35 38 31 24 33 35 16 4 30 27 10 12 22 6 24 12 30 23 21 14 12 32 21 7 12 25 43 18 34 34 28 47 13 28 43 18 39 44 42 35 26 35 14 8 29 32 20 29 3 20 6 20 9 9 27 8 42 10 37 42 27 8 1
30
100
85 50 17 89 65 89 5 20 86 26 16 21 85 14 44 31 87 31 6 2 48 67 8 80 79 1 48 36 97 1 5 30 79 50 78 12 2 55 76 100 54 40 26 81 97 96 68 56 87 14 51 17 54 37 52 33 69 62 38 63 74 15 62 78 9 19 67 2 60 58 93 60 18 96 55 48 34 7 79 82 32 58 90 67 20 50 27 15 7 89 98 10 11 15 99 49 4 51 77 52
29
100
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
30
1
1
1
4
4 1 2 3
2
5
2 2 2 4 4
2
4
100 99 99 100
2
from collections import defaultdict,OrderedDict,Counter
from itertools import permutations,combinations
from bisect import bisect_left,bisect_right
from queue import Queue,PriorityQueue
from heapq import heapify,heappop,heappush
from statistics import median
from math import gcd,sqrt,floor,factorial,ceil,log2,log10
from copy import deepcopy
from random import random,randint,randrange

import math
import bisect
import collections
import random
import heapq
import string

mod = 10**9 + 7


"""
--------- Points to Remember --------

1 - The average of a group of numbers always has a value between the minimum and maximum numbers in that group.

2 - Best approach to obtain the maximum sum of averages of two subsequences, is to put the maximum number alone into one subsequence, and the rest of the numbers into the other subsequence.

3 - Can split it into exactly n pairs (i. e. each element should be in exactly one pair) so that the sum of the two elements in each pair is odd (i. e. when divided by 2, the remainder is 1).

    Answer is 'yes' if and only if there are exactly n odd numbers.
    
4 - To make the arithmetic mean be equal to exactly 1 the sum needs to be equal to the number of elements in the array.

5 - Remember for questions in Partition Array type, maybe min or max when taken pair-wise may be helpful.

6 - The maximum sum we can construct with n elements is 1+3+5+7+⋯+2n−1=n*n, so we need at least ⌈s√⌉ elements to construct the sum equal to s. - 1550A

7 - Since P≥5 and is also a prime number, we know that P−1 is an even composite number. A even composite number is guaranteed to have at least 2 unique divisors greater than 1. Let two of these divisors be a and b. It is guaranteed that P % a=P % b=1, and thus this selection is valid. For example, we can simply pick a=2 and b=P−1, and we will get a correct solution.

8 - In order to check that point R lays between P and Q on a straight line, just check min(P,Q)<R<max(P,Q).

9 - The Shortest Path in no obstacle case is |xA−xB|+|yA−yB|.

10 - Swapping two adjacent numbers keeps both of them close to their original location and changes both of their locations. If n is even, the optimal distance is n, and if n is odd the optimal distance is n+1.

11 - We can easily observe that the msb (Highest set bit in n) in N will become 0 for the first time when K = 2**msb − 1. All the other bits will become zero when K = 2**msb.

12 - string.ascii_lowercase = "abcdefghijklmnopqrstuvwxyz"

13 - The main idea is that we can split the numbers into the two halves, the big half and small half, we can place the bigger half at the odd positions and the smaller half at the even positions.
    
    This works because the smallest big number is larger than any of the biggest small number. Hence, the mean of any two small numbers is smaller than any big number, and the mean of any two big numbers is bigger than any small number.

14 - For the GCD of the whole array to be greater than 1, each of the elements must have a common prime factor.

15 - If the number x has an odd divisor, then it has an odd prime divisor. There is only one even prime number — 2. So, if a number has no odd divisors, then it must be a power of two.

16 - If the number — is a power of two, then it contains only one unit in the binary notation. Then (n−1) contains units in all positions except the one in which the unit in n is located. So their bitwise "AND" equals 0, i.e, n&(n-1) = 0.

17 - Note that,  ceil((a+b)/k) <= ceil(a/k) + ceil(b/k). Thus, to maxmize we take each element of array separately, and to minimize,we merge all the elements into their sum value.

18 - Let's consider the smallest amount of blocks we need to make the first 'i' heights ascending. As heights are non-negative and ascending the heights should look like 0,1,2,3,...,i−1, so the minimum sum is (i−1)*i / 2. If it's not the case for every prefix, the answer is NO because we can't make some prefix ascending.

19 - Any array can be sorted using no more than n * (n−1) // 2 operations.

--------- Points to Remember --------
"""


"""
--------- Pre - Defined Functions --------
"""

class TrieNode:
    def __init__(self):
        self.children = [None] * 26
        self.isEndOfWord = False
        
class Trie:
    def __init__(self):
        self.root = self.getNode()
        
    def getNode(self):
        return TrieNode()
        
    def _charToIndex(self, ch):
        return ord(ch) - ord('a')
        
    def insert(self, key):
        pCrawl = self.root
        length = len(key)
        for level in range(length):
            index = self._charToIndex(key[level])
            if not pCrawl.children[index]:
                pCrawl.children[index] = self.getNode()
            pCrawl = pCrawl.children[index]
        pCrawl.isEndOfWord = True
        
    def search(self, key):
        pCrawl = self.root
        length = len(key)
        for level in range(length):
            index = self._charToIndex(key[level])
            if not pCrawl.children[index]:
                return False
            pCrawl = pCrawl.children[index]
        return pCrawl != None and pCrawl.isEndOfWord


class Node:
    def __init__(self, data):
        self.data = data
        self.count=0
        self.left = None  # left node for 0
        self.right = None  # right node for 1
        
class BinaryTrie:
    def __init__(self):
        self.root = Node(0)
        
    def insert(self, pre_xor):
        self.temp = self.root
        for i in range(31, -1, -1):
            val = pre_xor & (1 << i)
            if val:
                if not self.temp.right:
                    self.temp.right = Node(0)
                self.temp = self.temp.right
                self.temp.count+=1
            if not val:
                if not self.temp.left:
                    self.temp.left = Node(0)
                self.temp = self.temp.left
                self.temp.count += 1
        self.temp.data = pre_xor
        
    def query(self, xor):
        self.temp = self.root
        for i in range(31, -1, -1):
            val = xor & (1 << i)
            if not val:
                if self.temp.left and self.temp.left.count>0:
                    self.temp = self.temp.left
                elif self.temp.right:
                    self.temp = self.temp.right
            else:
                if self.temp.right and self.temp.right.count>0:
                    self.temp = self.temp.right
                elif self.temp.left:
                    self.temp = self.temp.left
            self.temp.count-=1
        return xor ^ self.temp.data
        

class SegmentTree:
    def __init__(self, data, default=0, func=lambda a, b:a + b):
        """initialize the segment tree with data"""
        self._default = default
        self._func = func
        self._len = len(data)
        self._size = _size = 1 << (self._len - 1).bit_length()
        self.data = [default] * (2 * _size)
        self.data[_size:_size + self._len] = data
        for i in reversed(range(_size)):
            self.data[i] = func(self.data[i + i], self.data[i + i + 1])
 
    def __delitem__(self, idx):
        self[idx] = self._default
 
    def __getitem__(self, idx):
        return self.data[idx + self._size]
 
    def __setitem__(self, idx, value):
        idx += self._size
        self.data[idx] = value
        idx >>= 1
        while idx:
            self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
            idx >>= 1
 
    def __len__(self):
        return self._len
 
    def query(self, start, stop):
        if start == stop:
            return self.__getitem__(start)
        stop += 1
        start += self._size
        stop += self._size
 
        res = self._default
        while start < stop:
            if start & 1:
                res = self._func(res, self.data[start])
                start += 1
            if stop & 1:
                stop -= 1
                res = self._func(res, self.data[stop])
            start >>= 1
            stop >>= 1
        return res
 
    def __repr__(self):
        return "SegmentTree({0})".format(self.data)
        

class SegmentTree1:
    def __init__(self, data, default=300006, func=lambda a, b: min(a , b)):
        """initialize the segment tree with data"""
        self._default = default
        self._func = func
        self._len = len(data)
        self._size = _size = 1 << (self._len - 1).bit_length()
 
        self.data = [default] * (2 * _size)
        self.data[_size:_size + self._len] = data
        for i in reversed(range(_size)):
            self.data[i] = func(self.data[i + i], self.data[i + i + 1])
 
    def __delitem__(self, idx):
        self[idx] = self._default
 
    def __getitem__(self, idx):
        return self.data[idx + self._size]
 
    def __setitem__(self, idx, value):
        idx += self._size
        self.data[idx] = value
        idx >>= 1
        while idx:
            self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
            idx >>= 1
 
    def __len__(self):
        return self._len
 
    def query(self, start, stop):
        if start == stop:
            return self.__getitem__(start)
        stop += 1
        start += self._size
        stop += self._size
 
        res = self._default
        while start < stop:
            if start & 1:
                res = self._func(res, self.data[start])
                start += 1
            if stop & 1:
                stop -= 1
                res = self._func(res, self.data[stop])
            start >>= 1
            stop >>= 1
        return res
 
    def __repr__(self):
        return "SegmentTree({0})".format(self.data)
        

class DualSegmentTree:
    def __init__(self, n, segfunc, ide_ele):
        self.segfunc = segfunc
        self.ide_ele = ide_ele
        self.num = 1 << (n - 1).bit_length()
        self.tree = [ide_ele] * 2 * self.num
 
    def update(self,l,r,x):
        l += self.num
        r += self.num
        while l < r:
            if l & 1:
                self.tree[l] = self.segfunc(self.tree[l],x)
                l += 1
            if r & 1:
                self.tree[r-1] = self.segfunc(self.tree[r-1],x)
            l >>= 1
            r >>= 1
 
    def __getitem__(self,idx):
        idx += self.num
        res = self.ide_ele
        while idx:
            res = self.segfunc(res,self.tree[idx])
            idx>>=1
        return res
 
 
class LazySegmentTree():
    __slots__ = ["merge","merge_unit","operate","merge_operate","operate_unit","n","data","lazy"]
    def __init__(self,n,init,merge,merge_unit,operate,merge_operate,operate_unit):
        self.merge=merge
        self.merge_unit=merge_unit
        self.operate=operate
        self.merge_operate=merge_operate
        self.operate_unit=operate_unit
 
        self.n=(n-1).bit_length()
        self.data=[merge_unit for i in range(1<<(self.n+1))]
        self.lazy=[operate_unit for i in range(1<<(self.n+1))]
        if init:
            for i in range(n):
                self.data[2**self.n+i]=init[i]
            for i in range(2**self.n-1,0,-1):
                self.data[i]=self.merge(self.data[2*i],self.data[2*i+1])
 
    def propagate(self,v):
        ope = self.lazy[v]
        if ope == self.operate_unit:
            return
        self.lazy[v]=self.operate_unit
        self.data[(v<<1)]=self.operate(self.data[(v<<1)],ope)
        self.data[(v<<1)+1]=self.operate(self.data[(v<<1)+1],ope)
        self.lazy[v<<1]=self.merge_operate(self.lazy[(v<<1)],ope)
        self.lazy[(v<<1)+1]=self.merge_operate(self.lazy[(v<<1)+1],ope)
 
    def propagate_above(self,i):
        m=i.bit_length()-1
        for bit in range(m,0,-1):
            v=i>>bit
            self.propagate(v)
 
    def remerge_above(self,i):
        while i:
            c = self.merge(self.data[i],self.data[i^1])
            i>>=1
            self.data[i]=self.operate(c,self.lazy[i])
 
    def update(self,l,r,x):
        l+=1<<self.n
        r+=1<<self.n
        l0=l//(l&-l)
        r0=r//(r&-r)-1
        self.propagate_above(l0)
        self.propagate_above(r0)
        while l<r:
            if l&1:
                self.data[l]=self.operate(self.data[l],x)
                self.lazy[l]=self.merge_operate(self.lazy[l],x)
                l+=1
            if r&1:
                self.data[r-1]=self.operate(self.data[r-1],x)
                self.lazy[r-1]=self.merge_operate(self.lazy[r-1],x)
            l>>=1
            r>>=1
        self.remerge_above(l0)
        self.remerge_above(r0)
 
    def query(self,l,r):
        l+=1<<self.n
        r+=1<<self.n
        l0=l//(l&-l)
        r0=r//(r&-r)-1
        self.propagate_above(l0)
        self.propagate_above(r0)
        res=self.merge_unit
        while l<r:
            if l&1:
                res=self.merge(res,self.data[l])
                l+=1
            if r&1:
                res=self.merge(res,self.data[r-1])
            l>>=1
            r>>=1
        return res
 
    def bisect_l(self,l,r,x):
        l += 1<<self.n
        r += 1<<self.n
        l0=l//(l&-l)
        r0=r//(r&-r)-1
        self.propagate_above(l0)
        self.propagate_above(r0)
        Lmin = -1
        Rmin = -1
        while l<r:
            if l & 1:
                if self.data[l][0] <= x and Lmin==-1:
                    Lmin = l
                l += 1
            if r & 1:
                if self.data[r-1][0] <=x:
                    Rmin = r-1
            l >>= 1
            r >>= 1
 
        res = -1
        if Lmin != -1:
            pos = Lmin
            while pos<self.num:
                self.propagate(pos)
                if self.data[2 * pos][0] <=x:
                    pos = 2 * pos
                else:
                    pos = 2 * pos +1
            res =  pos-self.num
        if Rmin != -1:
            pos = Rmin
            while pos<self.num:
                self.propagate(pos)
                if self.data[2 * pos][0] <=x:
                    pos = 2 * pos
                else:
                    pos = 2 * pos +1
            if res==-1:
                res = pos-self.num
            else:
                res = min(res,pos-self.num)
 
        return res
        
        
def binarySearchCount(arr, n, key):
    left = 0
    right = n - 1
 
    count = 0
    while (left <= right):
        mid = int((right + left) / 2)
        # Check if middle element is
        # less than or equal to key
        if (arr[mid] < key):
            count = mid + 1
            left = mid + 1
        # If key is smaller, ignore right half
        else:
            right = mid - 1
    return count
    

def sortLists(list1, list2):
    zipped_pairs = zip(list2, list1)
    z = [x for _, x in sorted(zipped_pairs)]
    return z
    
    
def computeGCD(x, y):
   while(y):
       x, y = y, x % y
   return x
  
   
def computeLCM(x, y):
   lcm = (x*y) // computeGCD(x,y)
   return lcm


def decToBin(n):
    return bin(n).replace("0b", "")
   
    
def binToDec(n):
    return int(n,2)
    
    
def isPrime(n):
    if n < 2:
        return False
    i = 2
    while i*i <= n:
        if n % i == 0:
            return False
        i += 1
    return True


def is_integer(n):
    return isinstance(n, int)
  
  
def sumDigits(num):
    ans = 0
    while num > 0:
        ans += num % 10
        num //= 10
    return ans


def sieveOfEratosthenes(n):
    prime = [True for i in range(n+1)]
    p = 2
    while (p * p <= n):
        # If prime[p] is not changed, then it is a prime.
        if (prime[p] == True):
            # Update all multiples of p.
            for i in range(p * p, n+1, p):
                prime[i] = False
        p += 1
        
    res = []
    for p in range(2, n+1):
        if prime[p]:
            res.append(p)
    return res
    
    
def dfsOfGraph(V, adj):
    vis = [0 for _ in range(V)]
    res = []
    
    def dfs(node):
        vis[node] = 1
        res.append(node)
        
        for nei in adj[node]:
            if not vis[nei]:
                dfs(nei)
    dfs(0)
    return res


def bfsOfGraph(V, adj):
    res = []
    vis = [0 for _ in range(V+1)]
    vis[0] = 1
    queue = deque([0])
    
    while queue:
        curr = queue.popleft()
        res.append(curr)
        for nei in adj[curr]:
            if not vis[nei]:
                vis[nei] = 1
                queue.append(nei)
    return res


def mex(arr, N):
    arr.sort()
    mex = 0
    for idx in range(N):
        if arr[idx] == mex:
            mex += 1
    return mex
    
    
"""
cdList = [inp1() for _ in range(n)]
"""


inp1 = lambda: input()
inp2 = lambda: int(input())
inp3 = lambda: list(input())
inp4 = lambda: map(int,input().split())
inp5 = lambda: list(map(int,input().split()))

"""
--------- Pre - Defined Functions --------
"""

n = inp2()
arr = inp5()

arr.sort()
sumT, sumC = sum(arr), 0
count = 0

for i in range(n-1, -1, -1):
    if sumC <= ceil(sumT/2):
        count += 1
        sumC += arr[i]

print(count)
    