#include <bits/stdc++.h>
using namespace std;
void insertion_sort(vector<int>& arr, int length) {
  int i, j, tmp;
  for (i = 1; i < length; i++) {
    j = i;
    while (j > 0 && arr[j - 1] > arr[j]) {
      tmp = arr[j];
      arr[j] = arr[j - 1];
      arr[j - 1] = tmp;
      j--;
    }
  }
}
int main() {
  int n, container;
  cin >> n;
  int sum = 0;
  int minimumSum = 0;
  vector<int> coinValues;
  while (n > 0) {
    cin >> container;
    sum += container;
    coinValues.push_back(container);
    n--;
  }
  insertion_sort(coinValues, coinValues.size());
  int j = 0;
  bool minimumAchieved = false;
  for (unsigned int i = coinValues.size() - 1; i >= 0 && !minimumAchieved;
       i--, j++) {
    minimumSum += coinValues[i];
    if (minimumSum >= (sum / 2 + 1)) minimumAchieved = true;
  }
  cout << j;
}
