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