#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  int wt = 0;
  int count = 0;
  for (int i = 0; i < n; i++) {
    if (wt <= a[i]) {
      count++;
      wt += a[i];
    }
  }
  cout << count;
}
int main() {
  ios::sync_with_stdio;
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
