#include <bits/stdc++.h>
using namespace std;
bool pre(int x);
long long gcd1(long long a, long long b);
int gcd2(int a, int b);
inline void write(int x);
inline void read(int &x);
inline void print(int x);
long long a[100002];
void accepted() {
  int n;
  cin >> n;
  for (int i = (1); i <= (n); i += (1)) cin >> a[i];
  sort(a + 1, a + n + 1);
  int su = 0, cnt = 0;
  for (int i = (1); i <= (n); i += (1)) {
    if (a[i] >= su) {
      cnt++;
      su += a[i];
    }
  }
  cout << cnt << endl;
}
int main() {
  cin.tie(0);
  cout.tie(0);
  accepted();
  return 0;
}
bool pre(int x) {
  if (x == 1 || x % 2 == 0 && x > 3) return false;
  int m = sqrt(x);
  for (int i = (3); i <= (m); i += (1))
    if (x % i == 0) return false;
  return true;
}
long long gcd1(long long a, long long b) {
  if (b == 0) return a;
  return gcd1(b, a % b);
}
int gcd2(int a, int b) {
  if (b == 0) return a;
  return gcd2(b, a % b);
}
inline void write(int x) {
  char F[200];
  int tmp = x > 0 ? x : -x;
  if (x < 0) putchar('-');
  int cnt = 0;
  while (tmp > 0) {
    F[cnt++] = tmp % 10 + '0';
    tmp /= 10;
  }
  while (cnt > 0) putchar(F[--cnt]);
}
inline void read(int &x) {
  int f = 1;
  x = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + (ch ^ 48);
    ch = getchar();
  }
  x *= f;
}
inline void print(int x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) print(x / 10);
  putchar(x % 10 + '0');
}
