#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long n;
  cin >> n;
  vector<unsigned long long> q(n);
  for (long long i = 0; i < n; i++) cin >> q[i];
  sort(q.begin(), q.end());
  vector<unsigned long long> ans;
  ans.push_back(q[0]);
  unsigned long long sum = q[0];
  for (long long i = 1; i < q.size(); i++) {
    if (q[i] >= sum) {
      ans.push_back(q[i]);
      sum += q[i];
    }
  }
  cout << ans.size() << endl;
  return 0;
}
