#include <bits/stdc++.h>
using namespace std;
int n;
int a[100005];
long long sum;
int ans;
long long now;
queue<int> q;
inline int read() {
  int f = 1, x = 0;
  char ch;
  do {
    ch = getchar();
    if (ch == '-') f = -1;
  } while (ch < '0' || ch > '9');
  do {
    x = x * 10 + ch - '0';
    ch = getchar();
  } while (ch >= '0' && ch <= '9');
  return f * x;
}
int main() {
  n = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) q.push(a[i]);
  while (!q.empty()) {
    now = q.front();
    q.pop();
    if (sum <= now) sum += now, ans++;
  }
  printf("%d", ans);
  return 0;
}
