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