#include <bits/stdc++.h>
using namespace std;
const int N = 100001;
const int mod = (int)(1e9 + 7);
int n, a[N], ans;
long long cur;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; ++i) {
    if (a[i] < cur) {
      continue;
    } else {
      cur += a[i];
      ++ans;
    }
  }
  cout << ans;
  return 0;
}
