#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, ans = 0, temp = 0;
  cin >> n;
  long long secondo[n];
  vector<long long> main(n);
  for (int i = 0; i < n; i++) cin >> main[i];
  sort(main.begin(), main.end());
  for (int i = 0; i < n; i++) {
    secondo[i] = main[i];
    if (i != 0) secondo[i] = secondo[i - 1] + secondo[i];
  }
  vector<long long>::iterator it;
  for (int i = 0; i < n; i++) {
    if (i != 0 && (secondo[i - 1] - temp) > main[i]) {
      it = lower_bound(main.begin() + i, main.end(), secondo[i - 1] - temp);
      if (it - main.begin() >= n) break;
      temp = secondo[it - main.begin() - 1] - secondo[i - 1] + temp;
      ans++;
      i = it - main.begin();
    } else
      ans++;
  }
  cout << ans << '\n';
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  int t = 1;
  while (t--) solve();
}
