#include <bits/stdc++.h>
using namespace std;
int sumofvector(vector<int> &coins) {
  int sum = 0;
  for (int i = 0; i < coins.size(); i++) {
    sum += coins[i];
  }
  return sum;
}
int main() {
  vector<int> coins;
  int n, temp, sumcheat = 0, sumother = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> temp;
    coins.push_back(temp);
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n - 1; j++) {
      if (coins[j] < coins[j + 1]) swap(coins[j], coins[j + 1]);
    }
  }
  while (sumcheat <= sumother) {
    sumcheat += coins[0];
    coins.erase(coins.begin());
    sumother = sumofvector(coins);
  }
  cout << n - coins.size();
  return 0;
}
