#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const int maxN = 1e6 + 5;
const int MOD = 10007;
int n;
int arr[maxN];
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = (0); i <= ((n)-1); ++i) cin >> arr[i];
  int x = 0;
  sort(arr, arr + n);
  long long time = arr[0];
  int ans = n;
  for (int i = (1); i <= ((n - 1)); ++i) {
    if (time > arr[i])
      ans--;
    else {
      time += arr[i];
    }
  }
  cout << ans;
  return 0;
}
