#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n], total = 0;
  ;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    total += a[i];
  }
  sort(a, a + n);
  int count = 0, coins = 0;
  while (coins <= total - coins) {
    count++;
    coins += a[n - count];
  }
  cout << count;
  return 0;
}
