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