#include <bits/stdc++.h>
using namespace std;
long long ans, tme;
int arr[100009];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  for (int i = 0; i < n; i++) {
    if (tme <= arr[i]) tme += arr[i], ans++;
  }
  cout << ans << "\n";
  return 0;
}
