#include "bits/stdc++.h"
using namespace std;
typedef long long ll; 
const ll INF = 1LL << 60;
const ll MOD = 998244353;
ll dp1[200000][16];
ll dp2[200000][16];
ll A[200000], B[200000];
int main() {
	int N;
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> A[i];
		B[i] = A[i] * 2;
	}
	fill((ll*)dp1, (ll*)(dp1 + N), INF);
	for (int i = 0; i <= 15; i++) dp1[N - 1][i] = i;
	for (int i = N - 2; i >= 0; i--) {
		if (A[i] <= A[i + 1]) {
			ll t = A[i];
			int k = 0;
			while (t <= A[i + 1]) {
				t *= 4;
				k++;
			}
			for (int j = 0; j <= 15; j++) {
				int x = max(j - k + 1, 0);
				dp1[i][j] = min(dp1[i][j], j + dp1[i + 1][x]);
			}
		}
		else {
			ll t = A[i + 1];
			int k = 0;
			while (t < A[i]) {
				t *= 4;
				k++;
			}
			for (int j = 0; j <= 15; j++) {
				int x = j + k;
				if (x >= 15) dp1[i][j] = min(dp1[i][j], j + dp1[i + 1][15] + (N - i - 1)*(x - 15));
				else dp1[i][j] = min(dp1[i][j], j + dp1[i + 1][x]);
			}
		}
	}
	fill((ll*)dp2, (ll*)(dp2 + N), INF);
	for (int i = 0; i <= 15; i++) dp2[0][i] = i;
	for (int i = 1; i < N; i++) {
		if (B[i] <= B[i - 1]) {
			ll t = B[i];
			int k = 0;
			while (t <= B[i - 1]) {
				t *= 4;
				k++;
			}
			for (int j = 0; j <= 15; j++) {
				int x = max(j - k + 1, 0);
				dp2[i][j] = min(dp2[i][j], j + dp2[i - 1][x]);
			}
		}
		else {
			ll t = B[i - 1];
			int k = 0;
			while (t < B[i]) {
				t *= 4;
				k++;
			}
			for (int j = 0; j <= 15; j++) {
				int x = j + k;
				if (x >= 15) dp2[i][j] = min(dp2[i][j], j + dp2[i - 1][15] + i * (x - 15));
				else dp2[i][j] = min(dp2[i][j], j + dp2[i - 1][x]);
			}
		}
	}
	ll ans = min(dp1[0][0] * 2, dp2[N - 1][0] * 2 + N);
	for (int i = 0; i + 1 < N; i++) {
		ans = min(ans, dp2[i][0] * 2 + (i + 1) + dp1[i + 1][0] * 2);
	}
	cout << ans << endl;
 }