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