#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<long long int> q;
  long long int n, sol = 0, acc = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int t;
    scanf("%d", &t);
    q.push_back(t);
  }
  sort(q.begin(), q.end());
  for (int i = 0; i < n; i++) {
    if (acc <= q[i])
      sol++;
    else
      q[i] = 0;
    acc += q[i];
  }
  cout << sol << "\n";
  return 0;
}
