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