#include <bits/stdc++.h>
using namespace std;
long long A[1 << 21];
int main() {
  long long n, count, sum;
  scanf("%lld", &n);
  for (long long i = 0; i < n; i++) scanf("%lld", &A[i]);
  sort(A, A + n);
  sum = count = 0ll;
  for (long long i = 0; i < n; i++) {
    if (A[i] >= sum)
      count++;
    else
      sum = sum - A[i];
    sum += A[i];
  }
  printf("%lld\n", count);
  return 0;
}
