#include <bits/stdc++.h>
using namespace std;

#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for(int64 i = 0;i < (n);i++)
#define FOR(i, a, b) for(int64 i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using ld = long double;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-10;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

const int64 mod = 1e9+7;


int main(void){
	int32 N;
	cin >> N;
	vector<int64> a(N);
	REP(i, N) cin >> a[i];
	vector<int64> cost1(N+1, 0), cost2(N+1, 0);
	int64 prev = INF;
	{
		vector<int64> b(a);
		stack<int32> st;
		REP(i, N){
			if(i > 0) cost1[i] = cost1[i-1];
			cost1[i]++;
			a[i] *= -2;
			if(i == 0){
				st.emplace(i);
			}else{
				while(a[i-1] > a[i]){
					a[i-1] *= 4;
					int32 j = st.top(); st.pop();
					if(j != i-1) a[j] *= 4;
					cost1[i] += (i-j)*2;
					if(j == 0 || a[j-1] <= a[j]*4) st.emplace(j);
				}
				if(a[i-1] <= a[i]*4) st.emplace(i);
			}
		}
		a = b;
	}
	prev = -INF;
	{
		vector<int64> b(a);
		stack<int32> st;
		for(int32 i = N-1;i >= 0;i--){
			if(i < N-1) cost2[i] = cost2[i+1];
			if(i == N-1){
				st.emplace(i);
				continue;
			}else{
				while(a[i] > a[i+1]){
					a[i+1] *= 4;
					int32 j = st.top(); st.pop();
					if(j != i+1) a[j] *= 4;
					cost2[i] += (j-i)*2;
					if(j == N-1 || a[j]*4 <= a[j+1]) st.emplace(j);
				}
				if(a[i]*4 <= a[i+1]) st.emplace(i);
			}
		}
		a = b;
	}
	int64 res = min(cost2[0], cost1[N-1]);
	REP(i, N-1){
		res = min(res, cost1[i]+cost2[i+1]);
	}
	cout << res << endl;
}
