#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a;
  int f[n + 1];
  f[0] = 0;
  for (int i = 0; i < n; i++) {
    int q;
    cin >> q;
    a.push_back(q);
  }
  sort(a.begin(), a.begin() + n);
  for (int i = 1; i <= n; i++) f[i] = f[i - 1] + a.at(i - 1);
  ;
  int count = 0;
  for (int i = n; i > 0; i--) {
    if (f[n] - f[i] > f[i])
      break;
    else
      count++;
  }
  cout << count;
  return 0;
}
