#include <bits/stdc++.h>
using namespace std;
int main() {
  int arr[100];
  int n;
  int sum = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    sum += arr[i];
  }
  for (int j = 0; j < n - 1; j++) {
    for (int i = 0; i < n - 1 - j; i++) {
      if (arr[i] > arr[i + 1]) swap(arr[i], arr[i + 1]);
    }
  }
  int h = 0;
  int j = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (j > sum)
      break;
    else {
      h++;
      j += arr[i];
      sum -= arr[i];
    }
  }
  cout << h << endl;
}
