#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int t[n];
  for (int i = 0; i < n; i++) {
    cin >> t[i];
  }
  sort(t, t + n);
  int sum = 0;
  int cont = 0;
  for (int i = 0; i < n; i++) {
    if (sum > t[i]) {
      continue;
    } else {
      cont++;
    }
    sum += t[i];
  }
  cout << endl << cont;
}
