#include <bits/stdc++.h>
using namespace std;
int main() {
  priority_queue<int> q;
  int count = 0;
  int n;
  cin >> n;
  while (n--) {
    int temp;
    cin >> temp;
    count += temp;
    q.push(temp);
  }
  count /= 2;
  int c(0), nc(0);
  while (c <= count) {
    nc++;
    c += q.top();
    q.pop();
  }
  cout << nc << endl;
  return 0;
}
