#include <bits/stdc++.h>
using namespace std;
const double e = 2.718281828;
const double pi = 3.1428571428;
const double EPS = 1e-9;
void OpenFiles() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL), cout.tie(NULL);
  priority_queue<int> Q;
  int n, t, sum = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> t;
    sum += t;
    Q.push(-t);
  }
  int res = 0, cur_sum = 0;
  while ((int)(Q).size()) {
    if (cur_sum <= -Q.top()) {
      cur_sum += (-Q.top());
      sum -= (-Q.top());
      Q.pop();
      res++;
    } else
      Q.pop();
  }
  cout << res;
  return 44 / 77;
}
