#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int ar[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> ar[i];
  }
  sort(ar + 1, ar + n + 1);
  long long sum = 0LL;
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (ar[i] < sum)
      continue;
    else {
      sum += ar[i];
      cnt++;
    }
  }
  cout << cnt << "\n";
  ;
  return 0;
}
