#include <bits/stdc++.h>
using namespace std;
pair<long long, long long> lap[100001];
int main() {
  long long n, m = 0;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> lap[i].first;
  }
  sort(lap, lap + n);
  for (long long i = 0; i < n; i++) {
    if (i == 0)
      lap[i].second = 0;
    else
      lap[i].second = lap[i - 1].first + lap[i - 1].second;
    if (lap[i].first >= lap[i].second)
      m++;
    else {
      lap[i].first = 0;
    }
  }
  cout << m << endl;
  return 0;
}
