#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int p;
  vector<int> numb;
  for (int i = 0; i < n; i++) {
    cin >> p;
    numb.push_back(p);
  }
  sort(numb.begin(), numb.end(), greater<int>());
  if (n == 1)
    cout << 1 << endl;
  else {
    for (int a = 1; a < n + 1; a++) {
      int sum1 = accumulate(numb.begin(), numb.begin() + a, 0);
      int sum2 = accumulate(numb.begin() + a, numb.end(), 0);
      if (sum1 > sum2) {
        cout << a << endl;
        break;
      }
    }
  }
  return 0;
}
