#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long int n;
  cin >> n;
  long long int a[n];
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  long long int b[n];
  b[0] = a[0];
  long long int cnt = 0;
  for (long long int i = 1; i < n; i++) {
    if (b[i - 1] > a[i]) {
      cnt++;
      b[i] = b[i - 1];
    } else {
      b[i] = b[i - 1] + a[i];
    }
  }
  cout << n - cnt << '\n';
}
