#include <bits/stdc++.h>
int main() {
  int m, i, j, a, b, c = 0, sum = 0;
  scanf("%d", &m);
  int arr[m];
  for (i = 0; i < m; i++) {
    scanf("%d", &arr[i]);
    sum += arr[i];
  }
  a = sum / 2;
  for (i = 0; i < m; i++) {
    for (j = i + 1; j < m; j++) {
      if (arr[i] < arr[j]) {
        b = arr[i];
        arr[i] = arr[j];
        arr[j] = b;
      }
    }
  }
  for (i = 1; i <= m; i++) {
    c += arr[i - 1];
    if (c > a) break;
  }
  printf("%d\n", i);
  return 0;
}
