#include <bits/stdc++.h>
using namespace std;
int n, a[100005], sum, ans, mx = -1;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    mx = max(mx, a[i]);
  }
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) {
    sum += a[i - 1];
    if (sum > mx) break;
    for (int j = i; j <= n; j++)
      if (a[j] >= sum) {
        int c = a[j];
        a[j] = a[i];
        a[i] = c;
        break;
      }
    if (sum > a[i])
      a[i] = 0;
    else
      ans++;
  }
  cout << ans;
  return 0;
}
