#include <bits/stdc++.h>
using namespace std;
const double PI = 3.141592653589793238;
bool DBG = false;
template <typename T, typename S>
std::ostream& operator<<(std::ostream& os, const std::pair<T, S>& p) {
  os << "(" << p.first << ", " << p.second << ")";
  return os;
}
template <typename T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& vector) {
  for (size_t i = 0; i < vector.size(); ++i) {
    os << vector[i] << " ";
  }
  return os;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> t(n);
  for (int i = 0; i < (int)(n); ++i) {
    cin >> t[i];
  }
  sort(t.begin(), t.end());
  long s = 0;
  int cnt = 0;
  for (int i = 0; i < (int)(n); ++i) {
    if (t[i] >= s) {
      cnt++;
      s += (long)t[i];
    }
  }
  cout << cnt << endl;
  return 0;
}
