#include <bits/stdc++.h>
using namespace std;
const double pi = 2 * acos(0);
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, s = 0, cnt = 0;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  for (int i = 0; i < n; i++) {
    if (s > a[i]) continue;
    s += a[i];
    cnt++;
  }
  cout << cnt << "\n";
  return 0;
}
