#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  int arr[n];
  int sum = 0;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    sum += arr[i];
  }
  sum = sum / 2 + 1;
  sort(arr, arr + n, greater<int>());
  for (int j = 0; j < n; j++) {
    if (sum <= 0) break;
    sum -= arr[j];
    ans++;
  }
  cout << ans << "\n";
}
