#include <iostream>
#include <string>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <unordered_map>
#include <map>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#include <functional>
#include <bitset>
#include <assert.h>
#include <unordered_map>
#include <fstream>
#include <time.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef pair<ll,ll> P;
typedef pair<int,int> pii;
typedef vector<P> vpl;
typedef tuple<ll,ll,ll> tapu;
#define rep(i,n) for(int i=0; i<(n); i++)
#define REP(i,a,b) for(int i=(a); i<(b); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
const int inf = 1<<30;
const ll linf = 1LL<<62;
const int MAX = 5020000;
ll dy[8] = {1,-1,0,0,1,-1,1,-1};
ll dx[8] = {0,0,1,-1,1,-1,-1,1};
const double pi = acos(-1);
const double eps = 1e-7;
template<typename T1,typename T2> inline bool chmin(T1 &a,T2 b){
	if(a>b){
		a = b; return true;
	}
	else return false;
}
template<typename T1,typename T2> inline bool chmax(T1 &a,T2 b){
	if(a<b){
		a = b; return true;
	}
	else return false;
}
template<typename T> inline void print(T &a){
    rep(i,a.size()) cout << a[i] << " ";
    cout << "\n";
}
template<typename T1,typename T2> inline void print2(T1 a, T2 b){cout << a << " " << b << "\n";}
template<typename T1,typename T2,typename T3> inline void print3(T1 a, T2 b, T3 c){
	cout << a << " " << b << " " << c << "\n";
}
template<typename T1,typename T2,typename T3,typename T4> inline void print4(T1 a, T2 b, T3 c, T4 d){
	cout << a << " " << b << " " << c << " " << d << "\n";
}
ll pcount(ll x) {return __builtin_popcountll(x);}
const int mod = 1e9 + 7;
//const int mod = 998244353;

int main(){
	int n; cin >> n;
	vl a(n); rep(i,n) cin >> a[i];
	int M = 62;
	vvl minus(n,vl(M,linf)), plus(n+1,vl(M,linf));
	for(int i=0; i<M; i+=2) plus[n][i] = 0; 
	rep(i,n){
		if(i==0){
			for(int j=1; j<M; j+=2) minus[i][j] = j;
			continue;
		}
		int cnt = 0;
		if(a[i-1] >= a[i]){
			ll tmp = a[i];
			while(a[i-1] >= tmp * 2) tmp *= 2, cnt++;
			if(cnt & 1) cnt--;
		}else{
			ll tmp = a[i-1];
			while(tmp < a[i]) tmp *= 2, cnt--;
			if(cnt & 1) cnt--; 
		}
		for(int j=1; j<M; j+=2){
			if(j+cnt >= M) break;
			if(j+cnt < 1) continue;
			chmin(minus[i][j+cnt], minus[i-1][j] + j+cnt);
		}
		if(cnt > 0) for(int j=1; j<=cnt; j+=2) chmin(minus[i][j], minus[i-1][1] + j);
		for(int j=1; j<M; j+=2) if(minus[i][j] == linf){
			minus[i][j] = minus[i][j-2] + i * 2 + 2;
		}
	}
	for(int i=n-1; i>=0; i--){
		if(i==n-1){
			for(int j=0; j<M; j+=2) plus[i][j] = j;
			continue;
		}
		int cnt = 0;
		if(a[i+1] >= a[i]){
			ll tmp = a[i];
			while(a[i+1] >= tmp * 2) tmp *= 2, cnt++;
			if(cnt & 1) cnt--;
		}else{
			ll tmp = a[i+1];
			while(a[i] > tmp) tmp *= 2, cnt--;
			if(cnt & 1) cnt--;
		}
		for(int j=0; j<M; j+=2){
			if(j+cnt >= M) break;
			if(j+cnt < 0) continue;
			chmin(plus[i][j+cnt], plus[i+1][j] + j+cnt);
		}
		if(cnt > 0) for(int j=0; j<cnt; j+=2) chmin(plus[i][j], plus[i+1][0] + j);
		for(int j=0; j<M; j+=2) if(plus[i][j] == linf){
			plus[i][j] = plus[i][j-2] + (n-i-1)*2 + 2;
		}
	}
	ll ans = plus[0][0];
	rep(i,n){
		chmin(ans, minus[i][1] + plus[i+1][0]);
	}
	cout << ans << "\n";
}

Measured memory_bytes: 214204