#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, sum = 0, minimum = 0, sum_min = 0;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum = sum + a[i];
  }
  sort(a, a + n);
  sum = sum / 2;
  for (int i = n - 1; i >= 0; i--) {
    sum_min = sum_min + a[i];
    minimum++;
    if (sum <= sum_min) break;
  }
  if (sum_min == sum) {
    minimum = minimum + 1;
    cout << minimum << endl;
  } else
    cout << minimum << endl;
}
