#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, sum = 0;
  cin >> n;
  vector<int> vec(n);
  for (int i = 0; i < n; i++) {
    cin >> vec[i];
    sum += vec[i];
  }
  int coins = 0;
  sort(vec.begin(), vec.end());
  int i = n;
  while (coins <= sum) {
    i--;
    coins += vec[i];
    sum -= vec[i];
  }
  cout << n - i << endl;
  return 0;
}
