#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, i, j, k, dp[100003][5], A[1000000], B[1000000], t, sum, ans;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> A[i];
  }
  sort(A, A + n);
  sum = A[0];
  ans = 1;
  for (i = 1; i < n; i++) {
    if (sum <= A[i]) {
      ans++;
      sum = sum + A[i];
    }
  }
  cout << ans;
}
