#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void y_k() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int32_t main() {
  y_k();
  long long n;
  cin >> n;
  long long *a = new long long[n];
  ;
  vector<long long> v;
  long long s = 0;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  for (long long i = 0; i < n; i++) {
    if (s <= a[i]) {
      v.push_back(a[i]);
      s += a[i];
    }
  }
  cout << v.size() << "\n";
  return 0;
}
