#include <bits/stdc++.h>
int getFldsFromLine(char *line, std::vector<char *> &res,
                    const char *sep = " \t\n\v\f\r");
int main(int argc, char **argv) {
  FILE *infile = stdin;
  char *line;
  line = (char *)calloc(1000000, sizeof(char));
  if (line == NULL) {
    fprintf(stderr, "Couldn't allocate space for '%s'\nBye!\n", "line");
    exit(-1);
  };
  std::vector<char *> flds;
  int numFlds, numCases, caseNum = 0;
  fgets(line, 1000000, infile);
  numFlds = getFldsFromLine(line, flds);
  int numCoins = atoi(flds[0]);
  fgets(line, 1000000, infile);
  numFlds = getFldsFromLine(line, flds);
  std::vector<int> coinValues;
  int totCoinValue = 0;
  for (int i = 0; i < numCoins; ++i) {
    int tval = atoi(flds[i]);
    totCoinValue += tval;
    coinValues.push_back(tval);
  }
  std::sort(coinValues.begin(), coinValues.end());
  std::reverse(coinValues.begin(), coinValues.end());
  int minValueNeeded = totCoinValue / 2 + 1;
  int runningTot = 0;
  for (int i = 0; i < numCoins; ++i) {
    runningTot += coinValues[i];
    if (runningTot >= minValueNeeded) {
      printf("%d\n", i + 1);
      break;
    }
  }
  return (0);
}
int getFldsFromLine(char *line, std::vector<char *> &res, const char *sep) {
  res.clear();
  char *tok = strtok(line, sep);
  while (tok) {
    res.push_back(tok);
    tok = strtok(0, sep);
  }
  return res.size();
}
