#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int sum = 0;
  vector<int> v;
  for (int i = 0; i < n; i++) {
    int elem;
    cin >> elem;
    v.push_back(elem);
    sum += elem;
  }
  sort(v.rbegin(), v.rend());
  int curr = 0;
  int count = 0;
  for (int i = 0; i < n; i++) {
    if (curr > sum) break;
    curr += v[i];
    sum -= v[i];
    count++;
  }
  cout << count << endl;
}
