#include <bits/stdc++.h>
using namespace std;
long GCD(long a, long b) {
  if (b == 0) return a;
  return GCD(b, a % b);
}
long long bigMod(long long b, long long p, long long m) {
  if (b == 1) return b;
  if (p == 0) return 1;
  if (p == 1) return b;
  if (p % 2 == 0) {
    long long temp = bigMod(b, p / 2, m);
    return (temp * temp) % m;
  } else
    return (b * bigMod(b, p - 1, m)) % m;
}
long long modInverse(long long a, long long m) { return bigMod(a, m - 2, m); }
int main() {
  int n;
  while (cin >> n) {
    vector<long long> v;
    for (int i = 0; i < n; i++) {
      long long a;
      cin >> a;
      v.push_back(a);
    }
    sort(v.begin(), v.end());
    long long serveTime = 0;
    int ans = 0;
    for (int i = 0; i < v.size(); i++) {
      if (serveTime <= v[i])
        ans++;
      else
        continue;
      serveTime += v[i];
    }
    cout << ans << endl;
  }
  return 0;
}
