#include <bits/stdc++.h>
using namespace std;
void READ(vector<long long> &v, long long n) {
  long long a;
  for (long long i = 0; i < n; i = i + 1) {
    cin >> a;
    v.push_back(a);
  }
}
void PRINT(vector<long long> &v) {
  long long a;
  for (long long i = 0; i < v.size(); i = i + 1) {
    cout << v[i] << " ";
  }
  cout << "\n";
}
long long power(long long k, long long n, long long m) {
  long long res = 1;
  while (n) {
    if (n % 2 != 0) {
      res = (res * k) % m;
    }
    k = (k * k) % m;
    n = n / 2;
  }
  return (res);
}
long long fact(long long n, long long m = 1000000007) {
  long long a = 1;
  if (n == 0 || n == 1) {
    return (1);
  }
  while (n > 0) {
    a = (a % m * n % m) % m;
    n--;
  }
  return (a);
}
long long n, m, k;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  std::cout.unsetf(std::ios::floatfield);
  std::cout.precision(6);
  long long a, b, c, d, e, x, i, j, t, y, w;
  double p, q, r, u;
  char ch, chr;
  cin >> n;
  vector<long long> v;
  READ(v, n);
  sort((v).begin(), (v).end());
  d = 0;
  for (i = 0; i < n; i = i + 1) {
    if (v[i] == v[0]) {
      d++;
    } else {
      break;
    }
  }
  a = v[0];
  c = 1;
  b = 1;
  while (true) {
    b = lower_bound(v.begin() + b, v.end(), a) - v.begin();
    if (b == n) {
      break;
    }
    a = a + v[b];
    c++;
    if (v[b] == v[n - 1]) {
      break;
    }
    b++;
  }
  cout << c;
}
