#include <bits/stdc++.h>
using namespace std;
void initial() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  initial();
  unsigned short n;
  cin >> n;
  unsigned short a[n];
  unsigned short prefix_sum[n];
  unsigned short ans = 1;
  for (unsigned long i = 0; i < (n); i++) {
    cin >> a[i];
  }
  if (n == 1) {
    cout << 1;
    return 0;
  }
  sort(a, a + n);
  prefix_sum[0] = a[0];
  signed short i;
  for (i = 1; i < n; i++) {
    prefix_sum[i] = prefix_sum[i - 1] + a[i];
  }
  unsigned short sum = 0;
  for (i = n; i > 1; i--) {
    sum += a[i - 1];
    if (sum > prefix_sum[i - 2]) {
      ans = n - i;
      break;
    }
  }
  cout << ans + 1;
  return 0;
}
