#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
void print() { cout << endl; }
template <typename T, typename... Types>
void print(T var1, Types... var2) {
  cout << var1 << " ";
  print(var2...);
}
template <typename T>
T fceil(T a, T b) {
  return (T)(a + b - 1) / b;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  int sum = 0;
  int dis = 0;
  for (int i = 0; i < n; i++) {
    if (sum > a[i]) {
      dis++;
    } else {
      sum += a[i];
    }
  }
  cout << n - dis << endl;
  return 0;
}
