#include <bits/stdc++.h>
using namespace std;
void swap(int &a, int &b) {
  int tmp = a;
  a = b;
  b = tmp;
}
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n - 1; i++)
    for (int j = i + 1; j < n; j++) {
      if (a[j] > a[i]) swap(a[j], a[i]);
    }
  int have = 0, have_values = 0, remain_values = 0;
  for (int i = 0; i < n; i++) remain_values += a[i];
  int i = 0;
  while (have_values <= remain_values && i < n) {
    have_values += a[i];
    remain_values -= a[i];
    have++;
    i++;
  }
  cout << have;
}
