#include <bits/stdc++.h>
using namespace std;
priority_queue<int> P;
int main() {
  int N;
  int tempo;
  int quant;
  cin >> N;
  int tmp;
  for (int i = 0; i < N; i++) {
    cin >> tmp;
    P.push(-tmp);
  }
  tempo = 0;
  quant = 0;
  while (!P.empty()) {
    tmp = -P.top();
    P.pop();
    if (tempo <= tmp) {
      quant++;
      tempo += tmp;
    }
  }
  cout << quant;
  return 0;
}
