#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<long long> arr;
  for (int i = 0; i < n; i++) {
    long long temp;
    cin >> temp;
    arr.push_back(temp);
  }
  sort(arr.begin(), arr.end());
  int disappointed = 1;
  long long totalTime = arr[0];
  for (int i = 1; i < n; i++) {
    if (arr[i] >= totalTime) {
      disappointed++;
      totalTime += arr[i];
    }
  }
  cout << disappointed << endl;
  return 0;
}
