#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n;
  vector<int> v;
  cin >> n;
  for (int i = (0); i < (int)(n); i++) {
    int x;
    cin >> x;
    v.push_back(x);
  }
  sort((v).begin(), (v).end());
  int time = 0;
  int happy = 0;
  for (int x : v) {
    if (time <= x) {
      ++happy;
      time += x;
    }
  }
  cout << happy << endl;
}
