#include <bits/stdc++.h>
using namespace std;
const int MAX = 100005;
int n;
multiset<int> t;
int main() {
  int tmp;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &tmp);
    t.insert(tmp);
  }
  int res = 0;
  long long sum = 0;
  multiset<int>::iterator iter;
  while ((iter = t.lower_bound(sum)) != t.end()) {
    res++;
    sum += *iter;
    t.erase(iter);
  }
  printf("%d\n", res);
  return 0;
}
