#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
using namespace std;
const long long MAX = 1000004;
const long long INF = 1e18L + 5;
template <typename Arg1>
void pn(Arg1&& arg1) {
  cout << arg1 << "\n";
}
template <typename Arg1, typename... Args>
void pn(Arg1&& arg1, Args&&... args) {
  cout << arg1 << "\n";
  pn(args...);
}
template <typename Arg1>
void ps(Arg1&& arg1) {
  cout << arg1 << " ";
}
template <typename Arg1, typename... Args>
void ps(Arg1&& arg1, Args&&... args) {
  cout << arg1 << " ";
  ps(args...);
}
template <typename Arg1>
void read(Arg1&& arg1) {
  cin >> arg1;
}
template <typename Arg1, typename... Args>
void read(Arg1&& arg1, Args&&... args) {
  cin >> arg1;
  read(args...);
}
long long g[MAX];
long long a[MAX];
void solve() {
  long long n;
  read(n);
  for (long long i = 0; i < n; ++i) read(a[i]);
  sort(a, a + n);
  long long ans = 1;
  long long t_s = a[0];
  for (long long i = 1; i < n; ++i) {
    if (t_s <= a[i]) {
      ans++;
      t_s += a[i];
    }
  }
  pn(ans);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  solve();
}
