#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);


	int N;
	cin >> N;
	int A[200000];
	rep(i, N) cin >> A[i];

	ll B[200001], C[200001];
	B[0] = 0;
	C[N] = 0;

	vector<int> V;
	ll mae = A[0];
	V.pb(0);
	rep(i, N) {
		ll a = A[i];
		B[i + 1] = B[i];
		if (mae >= a) {
			a *= 4;
			while (mae >= a) {
				V.pb(0);
				a *= 4;
			}
			V[(int)V.size() - 1]++;
		}
		else {
			while (mae < a) {
				int kari = V[(int)V.size() - 1];
				B[i + 1] += kari;
				if (V.size() > 1) {
					V.pop_back();
					V[(int)V.size() - 1] += kari;
				}
				mae *= 4;
			}
			V[(int)V.size() - 1]++;
		}
		mae = A[i];
	}
	V.clear();
	mae = A[N - 1];
	V.pb(0);
	for (int i = N - 1; i >= 0; i--) {
		ll a = A[i];
		C[i] = C[i + 1];
		if (mae >= a) {
			a *= 4;
			while (mae >= a) {
				V.pb(0);
				a *= 4;
			}
			V[(int)V.size() - 1]++;
		}
		else {
			while (mae < a) {
				int kari = V[(int)V.size() - 1];
				C[i] += kari;
				if (V.size() > 1) {
					V.pop_back();
					V[(int)V.size() - 1] += kari;
				}
				mae *= 4;
			}
			V[(int)V.size() - 1]++;
		}
		mae = A[i];
	}

	ll kotae = 1e18;
	rep(i, N + 1) {
		kotae = min(kotae, 2 * B[i] + 2 * C[i] + i);
	}
	co(kotae);

	Would you please return 0;
}