#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)
typedef long long ll;
const int MAX_N=2e5;
int N;
ll A[MAX_N];
ll dp[2][MAX_N][16];
int main(){
	cin>>N;
	REP(i,N)cin>>A[i];
	REP(q,2){
		REP(i,16)dp[q][N-1][i]=i;
		for(int i=N-2;i>=0;i--){
			ll x=A[i],y=A[i+1];
			int z=0;
			while(y<x){
				y<<=2;
				z++;
			}
			while(x<=y){
				x<<=2;
				z--;
			}
			x>>=2;
			z++;
			REP(j,16){
				ll d;
				if (z>=16){
					d=dp[q][i+1][15]+(z-15)*(N-(i+1));
				}else{
					d=dp[q][i+1][max(z,0)];
				}
				dp[q][i][j]=j+d;
				z++;
			}
		}
		reverse(A,A+N);
	}
	ll ans=dp[0][0][0]*2;
	FOR(i,1,N+1){
		ll tmp;
		if (i<N){
			tmp=dp[0][i][0]*2+dp[1][N-i][0]*2+i;
		}else{
			tmp=dp[1][0][0]*2+N;
		}
		ans=min(ans,tmp);
	}
	cout<<ans<<endl;
	return 0;
}