#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, sum = 0, check = 0, sum2 = 0;
  cin >> x;
  vector<int> in(x);
  for (int i = 0; i < x; i++) {
    cin >> in[i];
    sum += in[i];
  }
  sort(in.begin(), in.end());
  for (int i = x - 1; i >= 0; i--) {
    if (sum2 > sum / 2) {
      break;
    } else {
      check++;
      sum2 += in[i];
    }
  }
  cout << check;
}
