#include <bits/stdc++.h>
using namespace std;
int n, arr[100000 + 5];
int main() {
  cin >> n;
  multiset<int> queue;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    queue.insert(arr[i]);
  }
  int sum = 0, ans = 0;
  for (int i = 0; i < n; i++) {
    auto it = queue.lower_bound(sum);
    if (it == queue.end()) break;
    ans++;
    sum += *it;
    queue.erase(it);
  }
  printf("%d\n", ans);
}
