#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, counter = 0, sum = 0, x = 0;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    sum += arr[i];
  }
  sort(arr, arr + n);
  int i = n - 1;
  while (counter <= sum && sum != 0) {
    sum -= arr[i];
    counter += arr[i];
    i--;
    x++;
  }
  cout << x << endl;
  return 0;
}
