#include <bits/stdc++.h>
using namespace std;
int main() {
  int test, a, sum = 0, wait = 0, counter = 0;
  priority_queue<int, vector<int>, greater<int> > q;
  queue<int> qqq;
  cin >> test;
  int num = test;
  while (test--) {
    cin >> a;
    sum += a;
    q.push(a);
    qqq.push(a);
  }
  while (!q.empty()) {
    int serve = q.top();
    if (serve >= wait)
      counter++;
    else {
      q.pop();
      continue;
    }
    wait += serve;
    q.pop();
  }
  cout << counter << endl;
}
