#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  deque<long long int> v;
  for (int i = 0; i < n; i++) {
    long long int x;
    cin >> x;
    v.push_back(x);
  }
  sort(v.begin(), v.end(), greater<long long int>());
  long long int sum = 0, cnt = 0;
  long long int z = accumulate(v.begin(), v.end(), 0);
  for (int i = 0; i < n; i++) {
    sum = sum + v[i];
    z = z - v[i];
    cnt++;
    if (sum > z) {
      break;
    }
  }
  cout << cnt << "\n";
  return 0;
}
