#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int n;
int res;
ll sum;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  vector<ll> a(n + 1, 0);
  for (int i = 1; i <= n; ++i) cin >> a[i];
  sort(a.begin(), a.end());
  for (int i = 1; i <= n; ++i) {
    if (sum <= a[i])
      res++, sum += a[i];
    else
      continue;
  }
  cout << res << endl;
  return 0;
}
