#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
inline long long fpow(long long n, long long k, int p = MOD) {
  long long r = 1;
  for (; k; k >>= 1) {
    if (k & 1) r = r * n % p;
    n = n * n % p;
  }
  return r;
}
long long n, a[100005], res, tg;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) {
    if (a[i] >= tg) {
      res++;
      tg += a[i];
    }
  }
  cout << res;
}
