#include <bits/stdc++.h>
using namespace std;
int n, t[100005];
int main() {
  int T = 1;
  while (T--) {
    scanf("%d", &n);
    multiset<int> s;
    for (int i = (int)(1); i <= (int)(n); ++i)
      scanf("%d", t + i), s.insert(t[i]);
    long long sum = 0;
    int res = 0;
    for (int step = 0; step < (int)(n); ++step) {
      auto f = s.lower_bound(sum);
      if (f == s.end()) break;
      sum += *f;
      s.erase(f);
      ++res;
    }
    printf("%d\n", res);
  }
  return 0;
}
