#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, c, d, e, sum = 0, i;
  cin >> a;
  vector<int> vec;
  while (a--) {
    cin >> b;
    vec.push_back(b);
  }
  sort(vec.begin(), vec.end());
  int m = 0;
  for (i = 0; i < vec.size(); i++) {
    if (sum <= vec[i]) {
      sum += vec[i];
      m++;
    }
  }
  cout << m << endl;
}
