#include <bits/stdc++.h>
using namespace std;
int n, a[100010];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
  }
  sort(a, a + n);
  int wait = a[0];
  int c = n;
  for (int i = 1; i < n; ++i) {
    if (wait > a[i]) {
      c--;
    } else {
      wait += a[i];
    }
  }
  printf("%d", c);
  return 0;
}
