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