#include <bits/stdc++.h>
using namespace std;

#define mp              make_pair
#define pb              push_back
#define ff              first
#define ss              second
#define inc(A,B)        A=(A+(B))%MOD
#define mul(A,B)        (ll(A)*ll(B)%ll(MOD))
#define sub(a,b)        (((a)-(b)+MOD)%MOD)

typedef pair < int ,int > pii;
typedef long long ll;
typedef complex < ll > pt;

const int MAX_N = 100005;
const int MOD = 1e9 + 7;

int n, maxi;
int arr[MAX_N];

bool can ( int val ) {
  bool passOne = false;
  int firstVal = val;
  for ( int i = 0; i < n; ++i ) {
    if ( arr[i] == firstVal and !passOne ) {
      passOne = true;
      continue;
    }
    if ( arr[i] <= 2*val )
      val += arr[i];
    if ( 2*val >= maxi )
      return true;
  }
  return false;
}

int binSearch () {
  int fr = 0, to = n-1, mid;
  while ( fr < to ) {
    mid = (fr+to) / 2;
    if ( can ( arr[mid] ) )
      to = mid;
    else
      fr = mid+1;
  }
  return fr;
}

int main() {

//  freopen ( "in.txt" , "r" , stdin );
//  freopen ( "out.txt" , "w" , stdout );

  scanf ( "%d", &n );
  for ( int i = 0; i < n; ++i )
    scanf ( "%d", arr+i );

  sort ( arr, arr+n );
  maxi = arr[n-1];

  printf ( "%d\n", n-binSearch () );

  return 0;

}
