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