#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i, n, sum = 0, tmp = 0, d, l = 0;
  cin >> n;
  int a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
    sum = sum + a[i];
  }
  sort(a, a + n);
  reverse(a, a + n);
  for (i = 0; i < n; i++) {
    tmp = tmp + a[i];
    if (tmp > sum / 2) break;
  }
  cout << i + 1;
  return 0;
}
