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