#include <bits/stdc++.h>
using namespace std;
long long min(long long a, long long b, long long c) {
  if (a <= b && a <= c)
    return a;
  else if (b <= a && b <= c)
    return b;
  return c;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i += 1) cin >> arr[i];
  sort(arr, arr + n);
  int answer = 1;
  long long sum = arr[0];
  for (int i = 1; i < n; i += 1) {
    if (arr[i] >= sum) {
      answer += 1;
      sum += arr[i];
    }
  }
  cout << answer;
  return 0;
}
