#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (long long i = 0; i < n; i++) cin >> v[i];
  ;
  sort((v).begin(), (v).end());
  long long total = 0;
  int cnt = 0;
  for (long long i = 0; i < n; i++) {
    if (total <= v[i]) {
      total += v[i];
      cnt++;
    }
  }
  cout << cnt << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
