#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  multiset<long long> t;
  long long a, tot = 0, res = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a;
    t.insert(a);
  }
  set<long long>::iterator it = t.lower_bound(tot);
  while (it != t.end()) {
    tot += *it;
    ++res;
    t.erase(it);
    it = t.lower_bound(tot);
  }
  cout << res;
  return 0;
}
