#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, sum = 0;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  int r = sum / 2, x = 0;
  sort(a, a + n, std::greater<int>());
  for (int i = 0; i < n; i++) {
    x += a[i];
    if (x > r) {
      cout << i + 1 << endl;
      break;
    }
  }
  return 0;
}
