#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 sum = 0;
  int count = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] >= sum) {
      sum = sum + a[i];
      count++;
    }
  }
  cout << count;
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr), cout.tie(nullptr);
  int t = 1;
  while (t--) solve();
  return 0;
}
