#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  long long int arr[n];
  for (int i = 0; i < n; i++) scanf("%I64d", &arr[i]);
  sort(arr, arr + n);
  long long time = 0;
  int count = 0;
  for (int i = 0; i < n; i++) {
    if (time <= arr[i]) {
      count++;
      time += arr[i];
    }
  }
  printf("%d\n", count);
}
