#include<bits/stdc++.h>
using namespace std;
#define i64 long long int
#define ran 200020
int n;i64 a[ran],b[ran],L[ran],R[ran];

int ace[ran],w[ran];
int ancestor(int x){return x-ace[x]?ace[x]=ancestor(ace[x]):x;}

void proc(i64*a,i64*res){
	res[1] = 0;
	w[1] = 12345678;
	for(int i=1; i<=n; i++)ace[i] = i;
	for(int i=2; i<=n; i++){
		res[i] = res[i-1];
		w[i] = 0;
		if(a[i] <= a[i-1]){
			for(long long int x = a[i]*4; x <= a[i-1]; x*=4)
				w[i] ++;
		}else{
			for(long long int x = a[i-1]; x < a[i]; x *= 4){
				int to = ancestor(i-1);
				res[i] += i - to;
				if(--w[to] == 0)ace[to] = to-1;
			}
		}
		if(w[i] == 0)ace[i] = i-1;
	}
}
int main(){
	ios::sync_with_stdio(false);
	cin >> n;
	for(int i=1; i<=n; i++){
		cin >> a[i];
		b[i] = a[i];
	}
	proc(b,L);
	reverse(a+1, a+n+1);
	for(int i=1; i<=n; i++)b[i] = a[i];
	proc(b,R);
	reverse(R+1, R+n+1);
	i64 res = (i64)1e18;
	for(int i=0; i<=n; i++)res = min(res, (L[i] + R[i+1]) * 2 + i);
	cout << res << endl;
	return 0;
}
