#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n, x, coun = 0, A[100], sum = 0;
  cin >> n;
  for (i = 1; i <= 100; i++) A[i] = 0;
  for (i = 1; i <= n; i++) {
    cin >> x;
    sum += x;
    A[x]++;
  }
  x = 0;
  for (i = 100; i > 0; i--) {
    if (A[i] != 0)
      for (int j = 0; j < A[i]; j++) {
        x += i;
        coun += 1;
        if (x > sum / 2) {
          cout << coun;
          return 0;
        }
      }
  }
  return 0;
}
