#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> A;
  int n, m, sum = 0, sum2 = 0, count = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> m;
    sum = sum + m;
    A.push_back(m);
  }
  sum = sum / 2;
  sort(A.begin(), A.end(), greater<int>());
  for (int i = 0; sum2 <= sum; i++) {
    sum2 = sum2 + A[i];
    count++;
  }
  cout << count;
}
