#include <bits/stdc++.h>
using namespace std;
int a[(int)1e5 + 4];
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  long long int sum = 0;
  int ans = 0;
  for (int i = 1; i <= n; i++)
    if (a[i] >= sum) sum += a[i], ans++;
  cout << ans;
  return 0;
}
