#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9;
const long long N = 2e5 + 1;
const long long mod = 1e8;
const long double eps = 1E-7;
int lnt;
bool used[N];
int n, cnt;
int a[N];
vector<int> V;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + 1 + n);
  for (int i = 1; i <= n; i++) {
    if (a[i] >= cnt) {
      cnt += a[i];
      lnt++;
    }
  }
  cout << lnt;
}
