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

int main() {
	const ll INF = 1e18;
	ll N;
	cin >> N;
	vector<ll> a(N);
	for (int i = 0; i < N; ++i) { cin >> a[i]; }

	vector<vector<ll>> dp_p(N, vector<ll>(16, INF));
	vector<ll> p_min(N, INF);
	p_min[N - 1] = 0;
	for (int i = N - 1; i >= 0; --i) {
		if (i == N - 1) {
			for (int j = 0; j < 16; ++j) {
				dp_p[i][j] = j;
			}
			continue;
		}
		for (int j = 0; j < 16; ++j) {
			ll x = a[i] * pow(4LL, j);
			ll y = a[i + 1];
			ll cnt = 0;
			while (x > y) {
				y *= 4;
				++cnt;
			}
			if (cnt <= 15) {
				dp_p[i][j] = dp_p[i + 1][cnt] + j;
			} else {
				dp_p[i][j] = dp_p[i + 1][15] + j + (N - i - 1) * (cnt - 15);
			}
			p_min[i] = min(p_min[i], dp_p[i][j]);
		}
	}
	vector<vector<ll>> dp_n(N, vector<ll>(16, INF));
	vector<ll> n_min(N, INF);
	n_min[0] = 0;
	for (int i = 0; i < N; ++i) {
		if (i == 0) {
			for (int j = 0; j < 16; ++j) {
				dp_n[i][j] = j;
			}
			continue;
		}
		for (int j = 0; j < 16; ++j) {
			ll x = a[i] * pow(4LL, j);
			ll y = a[i - 1];
			ll cnt = 0;
			while (x > y) {
				y *= 4;
				++cnt;
			}
			if (cnt <= 15) {
				dp_n[i][j] = dp_n[i - 1][cnt] + j;
			} else {
				dp_n[i][j] = dp_n[i - 1][15] + j + i * (cnt - 15);
			}
			n_min[i] = min(n_min[i], dp_n[i][j]);
		}
	}

	ll res = INF;
	for (int i = -1; i < N; ++i) {
		ll p = INF, n = INF;
		if (i >= 0) { n = n_min[i] * 2; }
		else { n = 0; }

		if (i < N - 1) { p = p_min[i + 1] * 2; }
		else { p = 0; }

		res = min(res, p + n + i + 1);
	}

	cout << res << endl;

	return 0;
}
