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