#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  long long int a[n], b[n], i, c = 0;
  for (i = 0; i < n; i++) cin >> a[i];
  memset(b, 0, sizeof(b));
  sort(a, a + n);
  b[0] = a[0];
  for (i = 1; i < n; i++) {
    if (a[i] < b[i - 1]) {
      if (lower_bound(a + i, a + n, b[i - 1]) - a != n)
        swap(a[i], a[lower_bound(a + i, a + n, b[i - 1]) - a]),
            b[i] = a[i] + b[i - 1];
      else
        break;
    } else
      b[i] = a[i] + b[i - 1];
  }
  for (i = 0; i < n; i++) {
    if (b[i] != 0) c++;
  }
  cout << c << endl;
}
