#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int t, s1, s2, m;
  cin >> t;
  vector<int> arr(t);
  s1 = 0;
  for (int i = 0; i < t; i++) {
    cin >> arr[i];
    s1 += arr[i];
  }
  sort(arr.begin(), arr.end());
  m = 0;
  s2 = 0;
  for (int i = t - 1; i >= 0 && s1 >= s2; i--) {
    s2 += arr[i];
    s1 -= arr[i];
    m++;
  }
  cout << m << endl;
  return 0;
}
