#include <bits/stdc++.h>
int main() {
  int n, a[100], i, sum = 0, mus = 0, j;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    sum = sum + a[i];
  }
  for (i = 0; i < n - 1; i++) {
    for (j = i + 1; j < n; j++) {
      if (a[i] < a[j]) {
        int t = a[i];
        a[i] = a[j];
        a[j] = t;
      }
    }
  }
  i = 0;
  while (mus < sum / 2 + 1) mus = mus + a[i++];
  printf("%d", i);
  return 0;
}
