#include <bits/stdc++.h>
using namespace std;
int arr[100003];
int main() {
  int n, i;
  cin >> n;
  for (i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  long long wt = 0, res = 0;
  for (i = 0; i < n; i++) {
    if (wt <= arr[i]) {
      res++;
      wt += arr[i];
    }
  }
  cout << res << endl;
  return 0;
}
