#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, s = 0;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    s += a[i];
  }
  s /= 2;
  sort(a, a + n);
  int l = 0, k = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (l <= s) {
      l += a[i];
      k++;
    }
  }
  cout << k;
}
