#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<long long int> v;
  for (int i = 1; i <= n; i++) {
    long long int a;
    cin >> a;
    v.push_back(a);
  }
  sort(v.begin(), v.end());
  long long int total = 0;
  int cnt = 0;
  for (int i = 0; i < v.size(); i++) {
    total += v[i];
    if (total - v[i] <= v[i])
      ++cnt;
    else
      total -= v[i];
  }
  cout << cnt << endl;
}
