#include <bits/stdc++.h>
using namespace std;
int cmpfunc(const void *a, const void *b) { return *(int *)a - *(int *)b; }
int main() {
  int n;
  int count = 0;
  cin >> n;
  int t[100001];
  for (int i = 0; i < n; i++) cin >> t[i];
  qsort(t, n, sizeof(int), cmpfunc);
  int total = 0;
  for (int i = 0; i < n; i++) {
    if (t[i] >= total) {
      count++;
      total += t[i];
    }
  }
  cout << count << endl;
  return 0;
}
