#include <bits/stdc++.h>
using namespace std;
int main() {
  int count = 0, temp = 0, n, sum = 0;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    sum += arr[i];
  }
  sort(arr, arr + n);
  for (int i = n - 1; i >= 0; i--) {
    if (temp > sum / 2) {
      break;
    } else {
      count++;
      temp += arr[i];
    }
  }
  cout << count;
  return 0;
}
