#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64000000")
using namespace std;
bool f[100100];
vector<int> A, B;
int main() {
  int i, j, n, time, ans = 0;
  scanf("%d", &n);
  for (i = 0; i < n; ++i) {
    scanf("%d", &j);
    A.push_back(j);
  }
  sort(A.begin(), A.end());
  B = A;
  time = 0;
  int l, r;
  l = 0;
  r = n;
  for (i = 0; i < n; ++i) {
    j = lower_bound(B.begin() + l, B.end(), time) - B.begin();
    if (j < n) {
      if (time <= B[j]) {
        ans++;
      }
      time += B[j];
      B[j] = -1;
      l = j;
    } else
      break;
  }
  printf("%d", ans);
  return 0;
}
