#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace std;
void ash_god() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
const long long N = 2e6 + 10;
void solve() {
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i <= n - 1; i = i + 1) cin >> a[i];
  sort(a, a + n);
  long long sum = 0, res = 0;
  for (long long i = 0; i <= n - 1; i = i + 1) {
    if (sum <= a[i])
      ++res;
    else
      continue;
    sum += a[i];
  }
  cout << res;
}
int32_t main() {
  ash_god();
  bool tc = 0;
  if (tc) {
    long long t;
    cin >> t;
    while (t--) solve();
  } else
    solve();
  return 0;
}
