#include <iostream>
#include <cstdio>
#include <queue>
#include <stdlib.h>
#include <stack>
#include <string.h>
#include <set>
#include <iomanip>
#include <ctime>
#include <map>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <cstring>
#define eps 1e-15
#define ull unsigned long long
//priority_queue<int,vector<int>,greater<int> > q;
//priority_queue<int,vector<int>,less<int> > q;
//#define ls l, mid, rt << 1
//#define rs mid + 1, r, rt << 1 | 1
using namespace std;
typedef long long ll;
//typedef pair<int,int> P;
const int inf = 0x3f3f3f3f;
const int mod = 1e9+7;
const long long mod1 = 1e16;
//int gcd(int a, int b) {return a % b == 0 ? b : gcd(b, a % b);}
//int Find(int x){return x == p[x] ? x : p[x] = Find(p[x]);}
//#define lson 1<<rt
//#define rson 1<<rt|1
const int maxn=1e5+7;
#define pi 3.1415926535898
#define PI atan(1.0)*4
int dx[4]= {0,1,0,-1},dy[4]= {1,0,-1,0};
int dir[4][2]= {{1,0},{-1,0},{0,1},{0,-1}};
int dir1[8][2]= {{1,0},{-1,0},{0,1},{0,-1},{1,1},{-1,1},{1,-1},{-1,-1}};
//int d[]= {1,-1,4,-4}; //八数码问题
//----------------------------------------
int n,a[100001],ans;

bool check(int mid)
{
    int s=a[mid];
    for(int j=0;j<n;j++)
    {
        if(j!=mid)
        {
            if(a[j]>s*2)
                a[j]+=s;
            else
                return 0;
        }
    }
    return 1;
}

int main()
{
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    sort(a,a+n);
    int l=0,r=100000,mid;
    while(l<=r)
    {
        mid=(l+r)/2;
        if(check(mid))
        {
            r=mid-1;
        }
            else
            l=mid+1;
    }
    cout<<l-1<<endl;
    return 0;
}
