#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());
  time = 0;
  for (i = 0; i < n; ++i) {
    if (A[i] >= time) {
      time += A[i];
      ans++;
    }
  }
  printf("%d", ans);
  return 0;
}
