#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e+18;
int main() {
  long long n, i, sum = 0, res = 0;
  cin >> n;
  vector<long long> ar(n);
  for (i = 0; i < n; i++) cin >> ar[i];
  sort(ar.begin(), ar.end());
  for (i = 0; i < n; i++)
    if (ar[i] >= sum) {
      sum += ar[i];
      res++;
    }
  cout << res;
  return 0;
}
