#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
using namespace std;

const int64_t inf = (1LL << 50);

int64_t dp[200010][16];

vector<int64_t> computeScore(const std::vector<int64_t>& a) {
    int n = a.size();
    for (int x = 0; x <= 15; x++) {
        dp[n - 1][x] = 2 * x;
    }

    for (int i = n - 2; i >= 0; i--) {
        int64_t cur = a[i];
        for (int x = 0; x <= 15; x++) {
            dp[i][x] = inf;

            int64_t nxt = a[i + 1];
            int y = 0;

            while (nxt < cur) {
                nxt *= 4;
                y++;
            }

            if (y > 15) dp[i][x] = min(dp[i][x], dp[i + 1][15] + 2 * ((n - i - 1) * (y - 15) + x));
            else dp[i][x] = min(dp[i][x], dp[i + 1][y] + 2 * x);

            cur *= 4;
        }
    }
    std::vector<int64_t> score(n);
    for (int i = 0; i < n; i++) {
        score[i] = dp[i][0];
    }
    return score;
}

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

    int n;
    cin >> n;

    vector<int64_t> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }

    vector<int64_t> score1 = computeScore(a);

    reverse(a.begin(), a.end());

    vector<int64_t> score2 = computeScore(a);

    reverse(score2.begin(), score2.end());

    int64_t ans = (1LL << 50);

    for (int i = 0; i < n; i++) {
        ans = min(ans, i + score1[i] + (i > 0 ? score2[i - 1] : 0));
    }
    cout << ans << endl;

    return 0;
}