#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#pragma warning(disable : 4996)
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<unordered_map>
#include<unordered_set>
#include<time.h>
#include<random>
#include<array>


using namespace std;

#define REP(i, n) for(int i = 0;i < n;++i)
#define REPR(i, n) for(int i = n-1;i >= 0;--i)
#define FOR(i, m, n) for(int i = m;i < n;++i)
#define FORR(i, m, n) for(int i = m-1;i >= n;--i)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end())
#define ll long long
#define print(x) cout<<(x)<<'\n'
#define pe(x) cout<<(x)<<" "
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define lb(v,n) lower_bound(v.begin(), v.end(), (n))
#define ub(v,n) upper_bound(v.begin(), v.end(), (n))
#define int long long
//#define double long double
#define all(x) (x).begin(), (x).end()
#define print_space(v) REP(i,v.size())cout << v[i] << ((i == v.size() - 1) ? "\n" : " ")
template<typename T1, typename T2> inline void chmin(T1 & a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }
typedef pair<int, int>P;
typedef array<int, 3> arr3;
std::random_device rd;
std::mt19937 mt(rd());
constexpr ll MOD = 998244353; constexpr int MAX = 2000020;
const double pi = acos(-1); constexpr double EPS = 1e-8;
constexpr ll INF = 1e18;

int dp[200020][25];
int N;
ll A[200020];
bool done[200020][25];
int d[200020];
int calc(int i, int x) {
	//pe(i); print(x);
	if (x > 20) {
		return calc(i, 20) + (N - i)*(x - 20);
	}
	if (done[i][x])return dp[i][x];
	done[i][x] = true;
	if (i >= N - 1) {
		return dp[i][x]=x;
	}
	else {
		return dp[i][x]=x + calc(i + 1, max(0LL, x + d[i + 1]));
	}
}

ll B[200020];
int dB[200020];
int doneB[200020][25];
int dpB[200020][25];
int calcB(int i, int x) {
	if (x > 20) {
		return calcB(i, 20) + (N - i)*(x - 20);
	}
	if (doneB[i][x])return dpB[i][x];
	doneB[i][x] = true;
	if (i >= N - 1) {
		return dpB[i][x]=x;
	}
	else {
		return dpB[i][x]=x + calcB(i + 1, max(0LL, x + dB[i + 1]));
	}
}

void solve() {
	cin >> N;
	REP(i, N)cin >> A[i];
	REP(i, N)B[i] = A[N - i - 1];
	REP(i, N-1) {
		if (A[i + 1] < A[i] * 4) {
			int cnt = 0;
			ll tmp = A[i + 1];
			while (tmp < A[i]) {
				cnt++;
				tmp *= 4;
			}
			d[i + 1] = cnt;
		}
		else {
			ll tmp = A[i];
			int cnt = 0;
			while (tmp * 4 <= A[i + 1]) {
				cnt++;
				tmp *= 4;
			}
			d[i + 1] = -cnt;
		}

		if (B[i + 1] < B[i] * 4) {
			int cnt = 0;
			ll tmp = B[i + 1];
			while (tmp < B[i]) {
				cnt++;
				tmp *= 4;
			}
			dB[i + 1] = cnt;
		}
		else {
			ll tmp = B[i];
			int cnt = 0;
			while (tmp * 4 <= B[i + 1]) {
				cnt++;
				tmp *= 4;
			}
			dB[i + 1] = -cnt;
		}
	}
	ll ans = 1e18;
	REP(i, N) {
		ll res = 0;
		res += calc(i, 0) * 2;
		res += i;
		res += calcB(N - i, 0) * 2;
		//pe(i); print(res);
		ans = min(ans, res);
	}
	print(ans);
}

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	//int q; cin >> q;
	//while (q--)
	solve();
}



Measured memory_bytes: 137984