#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  vector<long long int> v(n);
  for (long long int i = 0; i < n; i++) cin >> v[i];
  sort(v.begin(), v.end());
  int count = 0, ans = 0;
  for (int i = 0; i < n; i++) {
    if (count <= v[i]) {
      count += v[i];
      ans++;
    }
  }
  cout << ans;
}
