#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, wait = 0, cnt = 0;
  cin >> n;
  long long a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    if (a[i] >= wait) {
      cnt++;
      wait += a[i];
    }
  }
  cout << cnt << endl;
}
