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