#include <bits/stdc++.h>
int n, a[100001], i, d = 0, s = 0;
int main() {
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  std::sort(a, a + n);
  for (i = 0; i < n; i++)
    if (a[i] >= s) {
      d++;
      s += a[i];
    }
  printf("%d", d);
}
