#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, c = 1, a, su = 0, su2 = 0;
  int f = 0;
  cin >> n;
  vector<int> v;
  for (int i = 0; i < n; i++) {
    cin >> a;
    v.push_back(a);
    su = su + a;
  }
  su2 = su / 2;
  sort(v.begin(), v.end());
  for (int i = n - 1; i != 0; i--) {
    f += v[i];
    if (su2 >= f) c++;
  }
  cout << c << endl;
  return 0;
}
