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