#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, c, j, max = 0, sum = 0, sump = 0, diff = 0;
  cin >> n;
  int* p = new int[n];
  for (int i = 0; i < n; i++) {
    cin >> p[i];
  }
  for (i = 0; i < n; i++) {
    for (j = i; j < n; j++) {
      if (p[i] >= p[j]) {
        continue;
      } else {
        max = p[i];
        p[i] = p[j];
        p[j] = max;
      }
    }
    sump += p[i];
  }
  for (c = 0; c < n; c++) {
    sum = sum + p[c];
    diff = sump - sum;
    if (sum > diff) {
      cout << c + 1;
      break;
    } else
      continue;
  }
}
