#include <bits/stdc++.h>
#define LL long long
#define PII pair<int,int>
using namespace std;
const int MAXN = 200005;
const int INF = (LL)1e9 + 5;
const LL MOD = 998244353;

#define pos first
#define pw second

int N;
LL a[MAXN], cnt1[MAXN], cnt2[MAXN];

void solve(LL *cnt) {
	vector<PII> stk;
	stk.push_back({N, INF});
	
	cnt[N - 1] = 0;
	for (int i = N - 2; i >= 0; i--) {
		LL add = 0;
		
		if (a[i] > a[i + 1]) {
			LL tmp = a[i + 1];
			while (a[i] > tmp) {
				tmp *= 4;
				add += (stk.back().pos - (i + 1)) * 2;
				stk.back().pw--;
				if (stk.back().pw <= 0) stk.pop_back();
			}
		}
		else {
			LL pw = 0, tmp = a[i];
			while (tmp <= a[i + 1]) {
				tmp *= 4;
				pw += 1;
			}
			if (pw > 1) stk.push_back({i + 1, (int)pw - 1});
		}
		
		cnt[i] = cnt[i + 1] + add;
	}
}

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);
	
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> a[i];
	}
	
	solve(cnt1);
	reverse(a, a + N);
	for (int i = 0; i < N; i++) a[i] *= 2;
	solve(cnt2);
	reverse(cnt2, cnt2 + N);
	for (int i = 0; i < N; i++) cnt2[i] += (i + 1);
	
	LL ans = min(cnt1[0], cnt2[N - 1]);
	for (int i = 0; i < N - 1; i++) {
		ans = min(ans, cnt2[i] + cnt1[i + 1]);
	}
	
	cout << ans << "\n";
}
