#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long int n;
  cin >> n;
  long long int arr[n];
  for (long long int i = 0; i < n; ++i) cin >> arr[i];
  sort(arr, arr + n);
  long long int time = 0, count = 0;
  for (long long int i = 0; i < n; ++i) {
    if (time <= arr[i]) {
      ++count;
      time += arr[i];
    }
  }
  cout << count << '\n';
}
