#include<bits/stdc++.h>
#define rep(i,x,y) for(register int i = x; i <= y; ++ i)
#define repd(i,x,y) for(register int i = x; i >= y; -- i)
typedef long long ll;
using namespace std;
template<typename T>inline bool chkmax(T&x,T y) { return x < y ? x = y,1 : 0; }
template<typename T>inline bool chkmin(T&x,T y) { return x > y ? x = y,1 : 0; }
template<typename T>inline void read(T&x)
{
	char c;int sign = 1;x = 0;
	do { c = getchar(); if(c == '-') sign = -1; }while(!isdigit(c));
	do { x = x * 10 + c - '0'; c = getchar(); }while(isdigit(c));
	x *= sign;
}
const int N = 2e5 + 50;
ll n,mx,l[N],r[N],ans;
ll a[N],b[N],s[N],cnt[N],top;

int main()
{
	read(n);
	rep(i,1,n) read(a[i]);
	rep(i,1,n) b[i] = a[i];
	l[1] = 1;
	rep(i,2,n)
	{
		while(a[i-1] < a[i])	
		{
			a[i-1] *= 4; ans += (i-s[top]-1)*2;
			-- cnt[top]; if(!cnt[top])--top;
		}
		if(a[i-1]/a[i]>=4)
		{
			s[++top] = i-1;
			while(a[i-1]/a[i] >= 4)
				a[i-1] /= 4,++ cnt[top];
		}
		l[i] = i + ans;
	}
	while(top) cnt[top--] = 0;
	ans = 0;
	r[n] = 0; s[0] = n + 1;
	rep(i,1,n) a[i] = b[i];
	repd(i,n-1,1)
	{
		while(a[i+1] < a[i])
		{
			a[i+1] *= 4; ans += (s[top]-i-1)*2;
			-- cnt[top]; if(!cnt[top]) -- top;
		}
		if(a[i+1]/a[i]>=4)
		{
			s[++top] = i + 1;
			while(a[i+1]/a[i] >= 4)
				a[i+1]/=4,++cnt[top];
		}
		r[i] = ans;
	}
	ans = l[n];
	rep(i,1,n) ans = min(ans,l[i-1] + r[i]);
	cout << ans << endl;
	
	return 0;
}