#include <bits/stdc++.h>
using namespace std;
#define debug(...) fprintf(stderr,__VA_ARGS__)
#define MK make_pair
#define PB push_back
#define fi first
#define se second

typedef long long LL;
typedef pair<int, int> PII;
const int N=2e5 +10 , K =20;
const LL oo = 1ll<<60;
const double log4= log(4);
LL dp[N][K], f[N], g[N];
int a[N],n;
double loga[N];
template<typename T>
void upmin(T &a, T b){ if ( a>b) a=b;}

void DP(LL *f){
	for (int i=1; i<=n; ++i) loga[i] = log(a[i]);
	for (int i=1; i<=n; ++i)
		for (int j=0; j<=16; ++j) dp[i][j] = i==n ? j : oo;
	f[n]= 0;
	#ifdef che
	debug("t4= %lf\n", (loga[n]-loga[n-1])/log4);
	#endif
	for (int i=n-1; i; --i){
		for (int j=0; j<=16; ++j){
			int t= int(floor( (loga[i+1]- loga[i])/log4))+j;
			t=min(16, t);
			if ( t<0 ) upmin(dp[i][0], dp[i+1][j] + (n-i)*-t);
				else upmin( dp[i][t], dp[i+1][j] + t);
			#ifdef che
			printf("j=%d, t=%d\n", j,t);
			#endif
		}
		#ifdef che
		for (int j=0; j<=16; ++j)
			printf("dp[%d][%d] = %lld\n", i,j, dp[i][j]);
		#endif
		f[i] = oo;
		for (int j=16; ~j; --j){
			upmin(f[i], dp[i][j]);
			if ( j) upmin(dp[i][j-1], dp[i][j]-1);
		}
	}
}
int main(){
	#ifdef che
	freopen("input.txt","rt",stdin);
	freopen("output.txt","wt",stdout);
	#endif
	scanf("%d", &n);for (int i=1; i<=n; ++i) scanf("%d", a+i);
	DP(f);
	reverse(a+1, a+n+1);
	DP(g);
	LL ans=oo;
	for (int i=1; i<=n ; ++i) ans= min(ans, 2*(f[i] + g[n-i+2]) + i-1);
	cout<<ans<<endl;
	return 0;
}