#include <bits/stdc++.h>
using namespace std;
int main() {
  priority_queue<int, vector<int>, greater<int> > x;
  int a, b, m = 0, n = 0;
  cin >> a;
  for (int i = 0; i < a; i++) {
    cin >> b;
    x.push(b);
  }
  while (!x.empty()) {
    if (x.top() >= m) {
      m += x.top();
      n++;
    }
    x.pop();
  }
  cout << n;
  return 0;
}
