#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> v;
  for (int i = 0, a; i < n; ++i) {
    cin >> a;
    v.push_back(a);
  }
  sort(v.begin(), v.end());
  queue<int> q;
  for (int i : v) {
    q.push(i);
  }
  long long cnt = 0, pref = 0;
  while (!q.empty()) {
    while (!q.empty() && pref > q.front()) {
      q.pop();
    }
    if (!q.empty()) {
      ++cnt;
      pref += q.front();
      q.pop();
    }
  }
  cout << cnt;
}
