#include <bits/stdc++.h>
using namespace std;
const int oo = 1e9 + 7;
int n, t[100010], res = 0, f = 0;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> t[i];
  sort(t + 1, t + n + 1);
  for (int i = 1; i <= n; ++i) {
    if (t[i] >= f) {
      f += t[i];
      res++;
    }
  }
  cout << res;
}
