#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[1001];
  int sum1 = 0, sum2 = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + n + 1);
  reverse(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) {
    sum2 += a[i];
  }
  int res = 0, i = 1;
  while (sum1 <= sum2) {
    sum1 += a[i];
    sum2 -= a[i];
    i++;
    res++;
  }
  cout << res;
}
