#include <bits/stdc++.h>
using namespace std;
long long int a[1000000];
long long int b[1000000];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int sum = 0;
  bool s = true;
  int count = 0;
  sort(a, a + n);
  int i = 0;
  for (i; i < n; i++) {
    bool s = false;
    for (int p = i; p < n; p++) {
      if (a[p] >= sum && a[p] != 0) {
        b[i] = a[p];
        a[p] = 0;
        count++;
        s = true;
        break;
      }
    }
    if (s == false) {
      break;
    }
    sum += b[i];
  }
  cout << count;
  return 0;
}
