#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, res = 0, s = 0, r = 0;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    s += arr[i];
  }
  sort(arr, arr + n);
  for (int i = n - 1; i > -1; i--) {
    res++;
    r += arr[i];
    s -= arr[i];
    if (r > s) break;
  }
  cout << res;
}
