#include <bits/stdc++.h>
using namespace std;
vector<int> t;
int main() {
  int n;
  scanf("%d", &n);
  if (n <= 2) {
    cout << n << endl;
    return 0;
  }
  int x, cnt = 2;
  long long sum;
  for (int i = 0; i < n; i++) {
    scanf("%d", &x);
    t.push_back(x);
  }
  sort(t.begin(), t.end());
  int i = 2;
  sum = t[0] + t[1];
  while (i < n) {
    if (t[i] >= sum) {
      sum += t[i];
      cnt++;
    }
    i++;
  }
  cout << cnt << endl;
  return 0;
}
