#include <bits/stdc++.h>
using namespace std;
void gogeta() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
void swap(long long* x, long long* y) {
  long long temp = *x;
  *x = *y;
  *y = temp;
}
int32_t main() {
  gogeta();
  long long n;
  cin >> n;
  long long arr[n];
  for (long long i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  long long wait = 0;
  long long count = 0;
  for (long long i = 0; i < n; i++) {
    if (arr[i] >= wait) {
      count++;
      wait += arr[i];
    }
  }
  cout << count << endl;
}
