#include <bits/stdc++.h>
using namespace std;
priority_queue<long long int, vector<long long int>, greater<long long int> > q;
int main() {
  int n;
  scanf("%d", &n);
  long long int x, sum = 0, ans = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &x);
    q.push(x);
  }
  while (q.size()) {
    x = q.top();
    q.pop();
    if (sum > x)
      ans++;
    else
      sum += x;
  }
  cout << n - ans << endl;
  return 0;
}
