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