#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  int sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    sum += a[i];
  }
  sort(a.rbegin(), a.rend());
  sum = sum / 2 + 1;
  int kolvo = 0;
  int partly = 0;
  for (int i = 0; i < n; i++) {
    partly += a[i];
    kolvo++;
    if (partly >= sum) {
      break;
    }
  }
  cout << kolvo;
  return 0;
}
