#include <bits/stdc++.h>
using namespace std;
int main() {
  int g = 0;
  int t = 0;
  int sum = 0;
  int n;
  int d = 0;
  cin >> n;
  int a[n];
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (a[i] > a[j]) {
        d = a[i];
        a[i] = a[j];
        a[j] = d;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    t = t + a[i];
  }
  while (sum <= t - sum) {
    g = g + 1;
    sum = sum + a[g];
  }
  cout << g;
  return 0;
}
