#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t;
  int wait = 0;
  vector<int> vect;
  stack<int> stk;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> t;
    vect.push_back(t);
  }
  sort(vect.begin(), vect.end());
  for (int i = 0; i < n; i++) {
    if (vect[i] < wait)
      stk.push(vect[i]);
    else
      wait = wait + vect[i];
  }
  int res = n - stk.size();
  cout << res << endl;
  return 0;
}
