#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  os << '[';
  for (const auto &x : v) os << " " << x;
  return os << ']';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int input, n;
  cin >> n;
  vector<long long int> vec;
  for (int i = 0; i < n; i++) {
    cin >> input;
    vec.push_back(input);
  }
  sort(vec.begin(), vec.end());
  long long int sum = 0, answer = 0;
  for (int i = 0; i < n; i++) {
    if (sum <= vec[i]) {
      answer++;
      sum += vec[i];
    }
  }
  cout << answer << endl;
}
