#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int guys[n];
  for (int i = 0; i < n; i++) {
    int m;
    cin >> m;
    guys[i] = m;
  }
  sort(guys, guys + n);
  int count = 0;
  long long timewaits = guys[0];
  for (int i = 1; i < n; i++) {
    if (timewaits > (long long)(guys[i]))
      count++;
    else
      timewaits += (long long)(guys[i]);
  }
  cout << n - count;
  return 0;
}
