#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i, n, sum = 0, sum1 = 0, ans = 0;
  cin >> n;
  vector<int> arr(n);
  for (i = 0; i < n; i++) {
    cin >> arr[i];
    sum += arr[i];
  }
  sort(arr.begin(), arr.end());
  for (i = arr.size() - 1; i > -1; i--) {
    sum1 += arr[i];
    sum -= arr[i];
    if (sum1 > sum) {
      ans++;
      break;
    } else
      ans++;
  }
  cout << ans << "\n";
}
