#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
int a[105];
int sum1=0,sum2=0;
cin>>n;
for(int i=0;i<n;i++){
cin>>a[i];
sum2 = sum2+a[i];
}
sort(a,a+n);
int cou=0;
for(int i=n-1;i>=0;i--){
sum1=sum1+a[i];
sum2 = sum2-a[i];
cou++;
if(sum1>sum2) {
cout<<cou<<"\n";
return 0;
}
}
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCl7CgogICAgaW50IG47CiAgICBpbnQgYVsxMDVdOwogICAgaW50IHN1bTE9MCxzdW0yPTA7CiAgICBjaW4+Pm47CgogICAgZm9yKGludCBpPTA7aTxuO2krKyl7CiAgICAgICAgY2luPj5hW2ldOwogICAgICAgIHN1bTIgPSBzdW0yK2FbaV07CiAgICB9CgogICAgc29ydChhLGErbik7CgogICAgaW50IGNvdT0wOwogICAgZm9yKGludCBpPW4tMTtpPj0wO2ktLSl7CiAgICAgICAgc3VtMT1zdW0xK2FbaV07CiAgICAgICAgc3VtMiA9IHN1bTItYVtpXTsKICAgICAgICBjb3UrKzsKICAgICAgICBpZihzdW0xPnN1bTIpIHsKICAgICAgICAgICAgY291dDw8Y291PDwiXG4iOwogICAgICAgICAgICByZXR1cm4gMDsKICAgICAgICB9CiAgICB9Cgp9Cgo=