#include <bits/stdc++.h>
using namespace std;
long long n;
int main() {
  cin >> n;
  long long arr[n + 5];
  for (long long i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  long long suma = 0, cont = 0;
  for (long long i = 0; i < n; i++) {
    if (suma > arr[i]) {
      cont++;
      suma -= arr[i];
    }
    suma += arr[i];
  }
  cout << n - cont;
  return 0;
}
