#include <bits/stdc++.h>
using ll = long long int;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int n;
  cin >> n;
  ll a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  ll m = 0;
  ll pre[n];
  pre[0] = a[0];
  int i = 1, j = 1;
  while (i < n) {
    m += a[j - 1];
    if (m <= a[i]) {
      pre[i] = m;
      i++;
      j = i;
    } else {
      pre[i] = a[i] + 1;
      i++;
      m -= a[j - 1];
    }
  }
  ll c = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] >= pre[i]) {
      c++;
    }
  }
  cout << c;
}
