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

#define ll long long 
#define N 200010
#define pii pair <int, int>
int n;
ll a[N], b[N], f[N], g[N], lazy; 

void Run()
{
	while (scanf("%d", &n) != EOF)
	{ 
		for (int i = 1; i <= n; ++i) scanf("%lld", a + i);
		queue <pii> q; 
		f[n] = 0;
		for (int i = n - 1; i >= 1; --i)
		{
			f[i] = f[i + 1];
			if (a[i] > a[i + 1]) 
			{
				ll tmp = a[i + 1];
				int cnt = 0;
				while (tmp < a[i])
				{
					tmp *= 4;  
					cnt += 2;
				}
				int x = i;
				while (!q.empty())
				{
					f[i] += 1ll * (q.front().second - x) * cnt;
					if (q.front().first <= cnt) cnt -= q.front().first; 
					else
					{
						pii tmpp = q.front();
						tmpp.first -= cnt;
						cnt = 0;
						q.pop();
						q.push(tmpp);
						break;
					}
					x = q.front().second;
					q.pop();
				}
				f[i] += 1ll * (n - x) * cnt;
			}
			else
			{
				ll tmp = a[i];
				int cnt = 0;
				while (tmp * 4 <= a[i + 1])
				{
					tmp *= 4;
					cnt += 2;
				}
				if (cnt) q.push(pii(cnt, i));   
			}
		}
		while (!q.empty()) q.pop();
		g[1] = 1;
		b[1] = -a[1];
		for (int i = 2; i <= n; ++i)
		{
			g[i] = g[i - 1] + 1;
			b[i] = -a[i];
			if (b[i] < b[i - 1])
			{
				ll tmp = b[i - 1];
				int cnt = 0;
				while (tmp > b[i])
				{
					tmp *= 4;
					cnt += 2;
				}
				int x = i;
				while (!q.empty())
				{
					g[i] += 1ll * (x - q.front().second) * cnt; 
					if (q.front().first <= cnt) cnt -= q.front().first;
					else
					{
						pii tmpp = q.front();
						q.pop();
						tmpp.first -= cnt; 
						cnt = 0;
						q.push(tmpp);
						break;
					}
					x = q.front().second;
					q.pop();
				}
				g[i] += 1ll * (x - 1) * cnt;
			}
			else
			{
				ll tmp = b[i];
				int cnt = 0;
				while (tmp * 4 >= b[i - 1])
				{
					tmp *= 4;
					cnt += 2;
				}
				if (cnt) q.push(pii(cnt, i));
			}
		}
		ll res = min(f[1], g[n]);
		for (int i = 1; i < n; ++i) res = min(res, g[i] + f[i + 1]);
		printf("%lld\n", res);
	}
}


int main()
{
	#ifdef LOCAL
		freopen("Test.in", "r", stdin); 
	#endif 

	Run();
	return 0;
}