#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, sum1 = 0, sum2 = 0, Min = 0;
  cin >> x;
  int p;
  vector<int> v;
  for (int j = 0; j < x; j++) {
    cin >> p;
    v.push_back(p);
  }
  sort(v.begin(), v.end());
  int s = v.size();
  for (int i = s - 1; i >= 0; i--) {
    sum1 = 0;
    sum2 = 0;
    for (int a = s - 1; a >= i; a--) {
      sum1 += v[a];
    }
    for (int k = i - 1; k >= 0; k--) {
      sum2 += v[k];
    }
    ++Min;
    if (sum1 > sum2) break;
  }
  cout << Min;
  return 0;
}
