#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
int t[MAXN];
int n, res;
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> t[i];
  }
  sort(t, t + n);
  for (long long i = 0, sum = 0; i < n; i++) {
    if (sum > t[i]) continue;
    sum += t[i];
    res++;
  }
  cout << res << endl;
  return 0;
}
