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