#include <bits/stdc++.h>
using namespace std;
void merge(int arr[], int front, int middle, int rear) {
  int i, j, k;
  int size1 = middle - front + 1;
  int size2 = rear - middle;
  int left[size1], right[size2];
  for (i = 0; i < size1; i++) {
    left[i] = arr[front + i];
  }
  for (j = 0; j < size2; j++) {
    right[j] = arr[middle + 1 + j];
  }
  i = 0;
  j = 0;
  k = front;
  while (i < size1 && j < size2) {
    if (left[i] <= right[j]) {
      arr[k] = left[i];
      i++;
    } else {
      arr[k] = right[j];
      j++;
    }
    k++;
  }
  while (i < size1) {
    arr[k] = left[i];
    i++;
    k++;
  }
  while (j < size2) {
    arr[k] = right[j];
    j++;
    k++;
  }
}
void mergeSort(int arr[], int front, int rear) {
  if (front < rear) {
    int middle = front + (rear - front) / 2;
    mergeSort(arr, front, middle);
    mergeSort(arr, middle + 1, rear);
    merge(arr, front, middle, rear);
  }
}
void printarr(int arr[], int size) {
  for (int i = 0; i < size; i++) {
    printf("%d ", arr[i]);
  }
  printf("\n");
}
int main() {
  int n;
  int arr[200000];
  int time = 0;
  int count = 1;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &arr[i]);
  }
  mergeSort(arr, 0, n - 1);
  time = arr[0];
  for (int i = 1; i < n; ++i) {
    if (arr[i] >= time) {
      count++;
      time += arr[i];
    }
  }
  printf("%d\n", count);
}
