#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, temp = 0, ans = 0;
  cin >> n;
  vector<int> queue(n);
  for (int i = 0; i < n; i++) cin >> queue[i];
  sort(queue.begin(), queue.end());
  for (int i = 0; i < n; i++) {
    if (queue[i] >= temp) {
      ans++;
      temp += queue[i];
    }
  }
  cout << ans;
}
