#include <bits/stdc++.h>
using namespace std;
long int a[100000];
int main() {
  int n, x = 0, t = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a, a + n + 1);
  for (int i = 1; i <= n; ++i) {
    if (x > a[i]) continue;
    t++;
    x += a[i];
  }
  cout << t << " ";
  return 0;
}
