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