#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <stack>
#include <limits>
using namespace std;

#define SZ(a) (int)(a).size()
using ll = long long;

vector<ll> f(vector<ll> a) {
    int n = SZ(a);
    vector<ll> b(n + 1);
    b[n] = 0;
    if (n > 1) b[n - 1] = 0;
    ll s = 0;
    stack<pair<int, int>> stk;
    for (int i = n - 2; i >= 0; i--) {
        // printf("%d\n", i);
        auto x = a[i];
        auto y = a[i + 1];
        int cnt = 0;
        while (y < x) {
            y *= 4;
            cnt++;
        }
        while (cnt > 0) {
            if (stk.empty()) {
                s += (ll)(n - i - 1) * cnt * 2;
                cnt = 0;
            } else {
                auto &p = stk.top();
                auto j = p.first;
                auto &c = p.second;
                int c1 = min(cnt, c);
                s += (ll)(j - i - 1) * c1 * 2;
                cnt -= c1;
                c -= c1;
                if (c == 0) {
                    stk.pop();
                }
            }
        }
        b[i] = s;
        x = a[i];
        y = a[i + 1];
        int cnt1 = 0;
        while (y >= 4 * x) {
            x *= 4;
            cnt1++;
        }
        if (cnt1 > 0) {
            stk.emplace(i + 1, cnt1);
        }
    }
    return b;
}

int main() {
    cin.sync_with_stdio(false);
    int n;
    cin >> n;
    vector<ll> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    auto b = f(a);
    reverse(begin(a), end(a));
    auto c = f(a);
    ll ans = numeric_limits<ll>::max();
    // for (int i = 0; i <= n; i++) {
    //     cerr << b[i] << " ";
    // }
    // cerr << "\n";
    // for (int i = 0; i <= n; i++) {
    //     cerr << c[i] << " ";
    // }
    // cerr << "\n";
    for (int i = 0; i <= n; i++) {
        ans = min(ans, b[i] + c[n - i] + i);
    }
    printf("%lld\n", ans);
    return 0;
}
