#include <bits/stdc++.h>
using namespace std;
long long n, s, m, k, l, i, j, x[300000], y[300000], h[300000];
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (i = 1; i <= n; i++) cin >> x[i];
  sort(x + 1, x + 1 + n);
  s = 0, k = 0;
  for (i = 1; i <= n; i++)
    if (s <= x[i]) k++, s += x[i];
  cout << k;
  return 0;
}
