#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
const long double EPSILON = 0.000000001;
const long long int mod = 1000000007;
const long long int AM = 2e5 + 5;
const long double pi = 3.14159265358979323846;
long long int max(long long int a, long long int b) {
  if (a > b)
    return a;
  else
    return b;
}
using namespace std;
long long int fact(long long int n) {
  long long int ans = 1;
  for (long long int i = 1; i <= n; i++) ans *= i;
  return ans;
}
long long int powm(long long int a, long long int b, long long int n) {
  long long int x = 1, y = a;
  while (b > 0) {
    if (b % 2 == 1) {
      x = (x * y) % n;
    }
    y = (y * y) % n;
    b /= 2;
  }
  return x % n;
}
long long int pow(long long int x, long long int y) {
  long long int res = 1;
  while (y > 0) {
    if (y & 1) res = ((res) * (x));
    y = y >> 1;
    x = ((x) * (x));
  }
  return res;
}
long long int min(long long int a, long long int b) {
  if (a > b)
    return b;
  else
    return a;
}
bool cmp(long double x, long double y) {
  if (abs(x - y) <= EPSILON) return 1;
  return 0;
}
long long int nCrModp(long long int n, long long int r, long long int p) {
  if (r > n - r) r = n - r;
  long long int C[r + 1];
  memset(C, 0, sizeof(C));
  C[0] = 1;
  for (long long int i = 1; i <= n; i++) {
    for (long long int j = min(i, r); j > 0; j--) C[j] = (C[j] + C[j - 1]) % p;
  }
  return C[r];
}
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int NcR(long long int n, long long int r) {
  long long p = 1, k = 1;
  if (n - r < r) r = n - r;
  if (r != 0) {
    while (r) {
      p *= n;
      k *= r;
      long long m = gcd(p, k);
      p /= m;
      p %= mod;
      k /= m;
      n--;
      r--;
    }
  } else
    p = 1;
  return p;
}
int main() {
  long long int n;
  cin >> n;
  vector<long long int> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  sort((v).begin(), (v).end());
  long long int cnt = 0;
  long long int sum = 0;
  for (int i = 0; i < n; i++) {
    if (sum <= v[i]) cnt++;
    if (sum <= v[i]) sum += v[i];
  }
  cout << cnt;
  return 0;
}
