#include <bits/stdc++.h>
using namespace std;
template <typename S, typename T>
ostream& operator<<(ostream& out, pair<S, T> const& p) {
  out << '(' << p.first << ", " << p.second << ')';
  return out;
}
template <typename T>
ostream& operator<<(ostream& out, vector<T> const& v) {
  int l = v.size();
  for (int i = 0; i < l - 1; i++) out << v[i] << ' ';
  if (l > 0) out << v[l - 1];
  return out;
}
template <typename T>
void trace(const char* name, T&& arg1) {
  cout << name << " : " << arg1 << endl;
}
template <typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " | ";
  trace(comma + 1, args...);
}
const int inf = 1e9 + 10;
const long long int INF = 1e18 + 10;
const int MOD = 1e9 + 7;
const int MAXN = 2e5 + 10;
void solve() {
  int n;
  cin >> n;
  int a[MAXN] = {0};
  for (int i = 0; i < n; i += 1) cin >> a[i];
  sort(a, a + n);
  a[n + 1] = inf;
  long long int sum = 0;
  int ans = 0;
  for (int i = 0; i < n; i += 1) {
    if (a[i] >= sum)
      ans++;
    else {
      int j = i;
      while (j < n && a[j] < sum) j++;
      if (a[j] >= sum) {
        ans++;
      }
      i = j;
    }
    sum += a[i];
  }
  cout << ans << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
