#include <bits/stdc++.h>
using namespace std;
int main() {
  int a = 0, sum = 0, x = 0;
  int y = 0;
  cin >> a;
  int arr[a];
  for (int i = 0; i < a; i++) {
    cin >> arr[i];
    sum = sum + arr[i];
  }
  sort(arr, arr + a, greater<int>());
  for (int i = 0; i < a; i++) {
    x = x + arr[i];
    if (x > sum / 2) {
      cout << i + 1;
      return 0;
    }
  }
  return 0;
}
