#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> a;
vector<int> ans;
long long s;
int res = 0;
void input() {
  cin >> n;
  a.assign(n, 0);
  for (int i = 0; i < n; ++i) cin >> a[i];
}
void G() {
  sort(a.begin(), a.end());
  s = a[0];
  res = 1;
  for (int i = 1; i < n; ++i) {
    if (a[i] >= s) {
      res++;
      s += a[i];
    }
  }
  cout << res << endl;
}
int main() {
  input();
  G();
  return 0;
}
