#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  long long t = 1;
  while (t--) {
    long long n;
    cin >> n;
    long long a[n];
    long long sum = 0;
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
      sum += a[i];
    }
    sort(a, a + n);
    long long temp = 0;
    long long ans = 0;
    for (long long i = n - 1; i >= 0; i--) {
      if (temp > sum) {
        break;
      }
      temp += a[i];
      sum -= a[i];
      ans++;
    }
    cout << ans << "\n";
  }
  return 0;
}
