#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  vector<int> vec;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    vec.emplace_back(x);
  }
  sort(vec.begin(), vec.end());
  int64_t sum = vec[0];
  int res = 1;
  for (int i = 1; i < vec.size(); ++i) {
    if (sum <= vec[i]) {
      ++res;
      sum += vec[i];
    }
  }
  cout << res << "\n";
  return 0;
}
