#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  vector<int> v(n);
  int twinSum = 0, mySum = 0, ans = 0;
  for (int &x : v) {
    cin >> x;
    twinSum += x;
  }
  sort(v.rbegin(), v.rend());
  for (auto x : v) {
    if (mySum > twinSum) {
      break;
    }
    mySum += x;
    twinSum -= x;
    ++ans;
  }
  cout << ans;
  return 0;
}
