#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
const double eps = 1e-9;
const int inf = 2000000000;
const long long infLL = 9000000000000000000;
int main() {
  long long n;
  cin >> n;
  vector<long long> v;
  for (int i = 0; i < n; i++) {
    long long temp;
    cin >> temp;
    v.push_back(temp);
  }
  sort(v.begin(), v.end());
  long long count = v[0];
  long long ans = 1;
  for (int i = 1; i < n; i++) {
    if (v[i] >= count) {
      ans++;
      count += v[i];
    }
  }
  cout << ans << '\n';
  return 0;
}
