#include <bits/stdc++.h>
using namespace std;
template <class TH>
void _dbg(const char *sdbg, TH h) {
  cerr << sdbg << " = " << h << "\n";
}
template <class TH, class... TA>
void _dbg(const char *sdbg, TH h, TA... a) {
  while (*sdbg != ',') cerr << *sdbg++;
  cerr << " = " << h << ", ";
  _dbg(sdbg + 1, a...);
}
const int maxn = 2e5 + 7;
const int inf = 1e9 + 7;
const int ABC = 26;
const long long LLinf = ((long long)1e18) + 7LL;
const long double eps = 1e-9;
long long sum;
int n, a[maxn], ans;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  for (int i = 0; i <= n - 1; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  for (int i = 0; i <= n - 1; i++) {
    for (int j = i; j <= n - 1; j++) {
      if (a[i] >= sum) {
        ans++;
        sum += a[i];
        break;
      }
    }
  }
  cout << ans;
}
