#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, sum = 0, take = 0;
  cin >> n;
  vector<int> v(n);
  for (int &x : v) {
    cin >> x;
    sum += x;
  }
  sort(v.begin(), v.end(), greater<int>());
  int j = 0;
  while (take * 2 <= sum) take += v[j++];
  cout << j << endl;
  return 0;
}
