#include <bits/stdc++.h>
using namespace std;
int main() {
  int sumk = 0, n, a[109], sum = 0, j, t = 0;
  cin >> n;
  for (size_t i = 0; i < n; i++) {
    cin >> a[i];
    sumk += a[i];
  }
  sort(a, a + n);
  reverse(a, a + n);
  for (j = 0; j < n; j++) {
    if (sum <= (sumk / 2)) {
      sum += a[j];
      t++;
    } else
      break;
  }
  if (t == n / 2 && sum <= sumk / 2) t++;
  cout << t;
}
