#include <bits/stdc++.h>
using namespace std;
long long a[100005];
bool used[100005];
int n;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  long long wait = 0;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int p = lower_bound(a, a + n, wait) - a;
    while (used[p] && p < n) p++;
    if (a[p] >= wait) {
      wait += a[p];
      ans++;
      used[p] = true;
    }
  }
  cout << ans;
  return 0;
}
