#include <bits/stdc++.h>
using namespace std;
long long n, read(), sum, ans;
priority_queue<long long, vector<long long>, greater<long long> > q;
int main() {
  scanf("%lld", &n);
  long long u;
  for (long long i = 1; i <= n; i++) {
    scanf("%lld", &u);
    q.push(u);
  }
  for (long long i = 1; i <= n; i++, q.pop())
    if (sum <= q.top()) ans++, sum += q.top();
  printf("%lld", ans);
  return 0;
}
