#include <bits/stdc++.h>
using namespace std;
int coins(int a[], int index, int sum1, int n) {
  int i{}, sum2{}, count{};
  if (index == -1) {
    return count;
  }
  sum1 += a[index];
  count++;
  for (i = 0; i < index; i++) {
    sum2 += a[i];
  }
  if (sum1 > sum2) {
    return count;
  } else {
    count += coins(a, index - 1, sum1, n);
  }
  return count;
}
int main() {
  int i{}, ind{}, sum{}, n{};
  cin >> n;
  int a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  cout << coins(a, n - 1, sum, n);
  return 0;
}
