#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
void solve() {
  int n;
  cin >> n;
  vector<int> v(n);
  int sum = 0;
  for (int i = 0; i < n; ++i) {
    cin >> v[i];
    sum += v[i];
  }
  sort(v.rbegin(), v.rend());
  int cnt = 0;
  int temp = 0;
  int i = 0;
  while ((sum / 2) >= temp) {
    temp += v[i];
    i++;
  }
  cout << i << '\n';
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
