#include <iostream>
#include <algorithm>
using namespace std;
int a[1000000],n,cnt,sum,ans=0,s=0;
int main(){zhong
cin>>n;
for(int i=1;i<=n;i)
{
cin>>a[i];
sum+=a[i];
}
sort(a+1,a+1+n);
int cnt = 1;
for(int i=n;i>=1;--i)
{
if(ans<=sum/2)
{
ans+=a[i];
cnt;
}
}
cout<<cnt-1;
return 0;
}