#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  int sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum = sum + a[i];
  }
  sort(a.begin(), a.end(), greater<int>());
  int i;
  int sum1 = 0;
  for (i = 0; i < n; i++) {
    sum1 = sum1 + a[i];
    sum = sum - a[i];
    if (sum1 > sum) break;
  }
  cout << i + 1;
  return 0;
}
