#include <bits/stdc++.h>
using namespace std;
map<long long, long long> m, m1;
vector<pair<int, int> > v;
long long a[1000005], b[1000005];
deque<long long> dq;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  a[0] = 0;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  long long sum = 0;
  int res = 0;
  for (int i = 1; i <= n; i++) {
    if (sum > a[i])
      res++;
    else
      sum += a[i];
  }
  cout << n - res << endl;
  return 0;
}
