#include <bits/stdc++.h>
using namespace std;
bool compare(int a, int b) { return a > b; }
int main() {
  int n;
  cin >> n;
  int a[n];
  int sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  sort(a, a + n, compare);
  int taken = 0, ans = 0;
  for (int i = 0; i < n; i++) {
    taken += a[i];
    sum -= a[i];
    ans++;
    if (taken > sum) {
      break;
    }
  }
  cout << ans << endl;
}
