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