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