#include <bits/stdc++.h>
using namespace std;
const long long INF = 1000000000;
const long long MOD = 1000000007;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  long long cur = 0, res = 0;
  for (long long i = 0; i < n; i++) {
    if (a[i] >= cur) ++res, cur += a[i];
  }
  cout << res << '\n';
  return 0;
}
