#include <bits/stdc++.h>
using namespace std;
int sum(vector<int> &v, int idx) {
  int s = 0;
  for (int i = 0; i <= idx; i++) {
    s += v[i];
  }
  return s;
}
int main() {
  int n, m, s, counter = 1;
  vector<int> v;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> m;
    v.push_back(m);
  }
  sort(v.begin(), v.end());
  s = v[v.size() - 1];
  for (int i = v.size() - 2; i >= 0; i--) {
    if (s > sum(v, i)) break;
    counter++;
    s += v[i];
  }
  cout << counter << endl;
  return 0;
}
