#include <bits/stdc++.h>
using namespace std;
const int N = 100100;
int n, a[N], ans, sum;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  sort(a, a + n);
  sum = ans = 0;
  for (int i = 0; n > i; i++) {
    if (a[i] < sum) continue;
    sum += a[i];
    ans++;
  }
  printf("%d\n", ans);
}
