#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (auto i = 0; i < n; ++i) {
    cin >> a[i];
  }
  sort(a.begin(), a.begin() + n);
  long long acc = a[0];
  auto cool = 1;
  for (auto i = 1; i < n; ++i) {
    if (acc <= a[i]) {
      cool++;
      acc += a[i];
    }
  }
  cout << cool;
}
