#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i, n, nd, a[100005], sum;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  sum = a[0];
  nd = 1;
  for (i = 1; i < n; i++) {
    if (a[i] >= sum) {
      sum += a[i];
      nd++;
    }
  }
  cout << nd;
  return 0;
}
