#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> nums;
  int sum = 0;
  for (int i = 0; i < n; ++i) {
    int temp;
    cin >> temp;
    sum += temp;
    nums.push_back(temp);
  }
  int collect = 0;
  int sum_new = 0;
  sort(nums.begin(), nums.end(), greater<int>());
  for (int i = 0; i < n; ++i) {
    sum_new += nums[i];
    collect++;
    if (sum_new > (sum - sum_new)) {
      cout << collect;
      return 0;
    } else {
      continue;
    }
  }
}
