#include <bits/stdc++.h>
using namespace std;
int main() {
  long long x, y = 0, z = 0, arr[(long long)1e5];
  cin >> x;
  for (int i = 0; i < x; i++) {
    cin >> arr[i];
  }
  sort(arr, arr + x);
  for (int i = 0; i < x; i++) {
    if (arr[i] >= y) {
      y += arr[i];
      z++;
    }
  }
  cout << z << endl;
  return 0;
}
