#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, arr[100005], sum = 0, i, ct = 0, temp;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> arr[i];
  }
  sort(arr, arr + n);
  for (i = 0; i < n; i++) {
    if (i != (n - 1)) {
      if (arr[i] >= sum) {
        ct++;
        sum += arr[i];
      } else if (arr[i + 1] >= sum) {
        ct++;
        sum += arr[i + 1];
        temp = arr[i];
        arr[i] = arr[i + 1];
        arr[i + 1] = temp;
      }
    } else {
      if (arr[i] >= sum) {
        ct++;
      }
    }
  }
  cout << ct << endl;
  return 0;
}
