#include<bits/stdc++.h>
//ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
//clock_t start=clock();clock_t end=clock();cout<<(double)(end-start)/CLOCKS_PER_SEC<<endl;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int,int> pii;
typedef pair<pii,int> ppii;
typedef pair<int,pii> pipi;
typedef pair<ll,ll> pll;
typedef pair<pll,ll> ppll;
typedef pair<ll,pll> plpl;
typedef tuple<ll,ll,ll> tl;
ll mod=1000000007;
ll mod2=998244353;
ll mod3=1000003;
ll mod4=998244853;
ll inf=1LL<<60;
double pi=3.141592653589793238462643383279L;
double eps=1e-10;
#define rep(i,m,n) for(int i=m;i<n;i++)
#define rrep(i,n,m) for(int i=n;i>=m;i--)
#define srep(itr,st) for(auto itr=st.begin();itr!=st.end();itr++)
#define Max(a,b) a=max(a,b)
#define Min(a,b) a=min(a,b)
int dh[4]={1,-1,0,0};
int dw[4]={0,0,1,-1};
int ddh[8]={-1,-1,-1,0,0,1,1,1};
int ddw[8]={-1,0,1,-1,1,-1,0,1};
ll gcd(ll a,ll b){
    if(a<b)swap(a,b);
    if(b==0)return a;
    if(a%b==0)return b;
    return gcd(b,a%b);
}
ll Pow(ll n,ll k){
    ll ret=1;
    ll now=n;
    while(k>0){
        if(k&1)ret*=now;
        now*=now;
        k/=2;
    }
    return ret;
}
ll beki(ll n,ll k,ll md){
  ll ret=1;
  ll now=n;
  while(k>0){
    if(k%2==1){
      ret*=now;
      ret%=md;
    }
    now*=now;
    now%=md;
    k/=2;
  }
  return ret;
}
ll gyaku(ll n,ll md){
  return beki(n,md-2,md);
}

int main(){
    ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    ll n;cin>>n;
    ll a[n];
    rep(i,0,n)cin>>a[i];
    ll cnt1[n];
    fill(cnt1,cnt1+n,0);
    deque<plpl> dq;
    dq.push_back({1,{a[0],a[0]}});
    rep(i,1,n){
        pll p={a[i],a[i]};
        ll su=1;
        cnt1[i]=cnt1[i-1];
        ll nma=a[i];
        while(dq.size()>0){
            plpl pp=dq.back();
            ll mi=pp.second.second,ma=pp.second.first,cnn=pp.first;
            if(mi>=4*nma){
                break;
            }
            else if(mi>=nma){
                dq.pop_back();
                su+=cnn;
                nma=ma;
                break;
            }
            else{
                dq.pop_back();
                ll u=0;
                while(mi<nma){
                    u++;
                    mi*=4;
                    ma*=4;
                }
                cnt1[i]+=2*cnn*u;
                su+=cnn;
                nma=ma;
            }
        }
        dq.push_back({su,{nma,a[i]}});
    }
    ll cnt2[n];
    fill(cnt2,cnt2+n,0);
    dq.clear();
    reverse(a,a+n);
    dq.push_back({1,{a[0],a[0]}});
    rep(i,1,n){
        pll p={a[i],a[i]};
        ll su=1;
        cnt2[n-i-1]=cnt2[n-i];
        ll nma=a[i];
        while(dq.size()>0){
            plpl pp=dq.back();
            ll mi=pp.second.second,ma=pp.second.first,cnn=pp.first;
            if(mi>=4*nma){
                break;
            }
            else if(mi>=nma){
                dq.pop_back();
                su+=cnn;
                nma=ma;
                break;
            }
            else{
                dq.pop_back();
                ll u=0;
                while(mi<nma){
                    u++;
                    mi*=4;
                    ma*=4;
                }
                cnt2[n-i-1]+=2*cnn*u;
                su+=cnn;
                nma=ma;
            }
        }
        dq.push_back({su,{nma,a[i]}});
    }
    /*rep(i,0,n)cout<<cnt1[i]<<" ";
    cout<<endl;
    rep(i,0,n)cout<<cnt2[i]<<" ";
    cout<<endl;*/
    ll ans=min(cnt1[n-1]+n,cnt2[0]);
    rep(i,0,n-1){
        Min(ans,cnt1[i]+i+1+cnt2[i+1]);
    }
    cout<<ans<<endl;
}






Measured memory_bytes: 4992