#include <stdio.h>
#include <assert.h>
#include <fstream>
#include <iostream>
#include <algorithm>
#include <array>
#include <vector>
#include <queue>
#include <set>
#include <cmath>
#include <iomanip>
//#include <unordered_map>
//#include <unordered_set>
//#include <boost/container/static_vector.hpp>
//#include <boost/unordered_set.hpp>
//#include <boost/unordered_map.hpp>
//#include <unistd.h>

long long pow_mod(long long x, long long n) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) { res = (res * x); }
        x = (x * x);
        n = (n >> 1);
    }
    return res;
}

struct Info {
    long long num;
    long long value;
};

const int MAX_N = 200050;
const int MAX_BEGIN_NUM = 33;
int N;
long long A[MAX_N];
long long positive_from[MAX_N][MAX_BEGIN_NUM], negative_from[MAX_N][MAX_BEGIN_NUM];
// positive_from[i][j] : A[i]に-2をj回かけて、i以降を正の増加数列にするときに、i+1以降に-2をかける最小値。A[i]に-2をj回かけて負なら-1

long long prev_comp[MAX_N], next_comp[MAX_N];

long long dp_pos[MAX_N][MAX_BEGIN_NUM], dp_neg[MAX_N][MAX_BEGIN_NUM];

long long calc_pos(const int begin, int cur_mul) {
    if (begin == N) {
        return 0;
    }

    if (cur_mul < MAX_BEGIN_NUM && dp_pos[begin][cur_mul] != -1) {
        return dp_pos[begin][cur_mul];
    }

    long long next_mul = std::max(cur_mul + prev_comp[begin+1], (long long)0);
    long long ret = next_mul;

    if (next_mul >= MAX_BEGIN_NUM) {
        ret += (next_mul - MAX_BEGIN_NUM + 1) * (N - begin - 1) + calc_pos(begin + 1, MAX_BEGIN_NUM - 1);
    } else {
        ret += calc_pos(begin + 1, next_mul);
    }

    if (cur_mul < MAX_BEGIN_NUM) {
        dp_pos[begin][cur_mul] = ret;
    }
    return ret;
}

long long calc_neg(const int begin, int cur_mul) {
    if (begin == 1) {
        return 0;
    }

    if (cur_mul < MAX_BEGIN_NUM && dp_neg[begin][cur_mul] != -1) {
        return dp_neg[begin][cur_mul];
    }

    long long next_mul = std::max(cur_mul + next_comp[begin-1], (long long)0);
    long long ret = next_mul;

    if (next_mul >= MAX_BEGIN_NUM) {
        ret += (next_mul - MAX_BEGIN_NUM + 1) * (begin - 2) + calc_neg(begin - 1, MAX_BEGIN_NUM - 1);
    } else {
        ret += calc_neg(begin - 1, next_mul);
    }

    if (cur_mul < MAX_BEGIN_NUM) {
        dp_neg[begin][cur_mul] = ret;
    }
    return ret;
}


int main(int argc, char **argv) {
    std::cin >> N;
    
    for (int i = 1; i <= N; i++) {
        std::cin >> A[i];
    }

    if (N == 1) {
        std::cout << 0 << std::endl;
        return 0;
    }

    prev_comp[1] = 0;
    for (int i = 2; i <= N; i++) {
        if (A[i] < A[i-1]) {
            long long tmp = A[i];
            int num = 0;
            while (tmp < A[i-1]) {
                tmp = tmp * 4;
                num++;
            }
            prev_comp[i] = num * 2;
        } else {
            long long tmp = A[i-1];
            int num = 0;
            while (tmp <= A[i]) {
                tmp = tmp * 4;
                num++;
            }
            prev_comp[i] = - (num - 1) * 2;
        }
    }

    next_comp[N] = 1;
    for (int i = N - 1; 1 <= i; i--) {
        if (A[i] < A[i+1]) {
            long long tmp = A[i];
            int num = 0;
            while (tmp < A[i+1]) {
                tmp = tmp * 4;
                num++;
            }
            next_comp[i] = num * 2;
        } else {
            long long tmp = A[i+1];
            int num = 0;
            while (tmp <= A[i]) {
                tmp = tmp * 4;
                num++;
            }
            next_comp[i] = - (num - 1) * 2; 
        }
    }

    for (int i = 1; i <= N; i++) {
        for (int j = 0; j < MAX_BEGIN_NUM; j++) {
            dp_pos[i][j] = -1;
            dp_neg[i][j] = -1;
        }
    }

    //std::cout << "check:" << prev_comp[4] << " " << prev_comp[5] << " " << calc_pos(3, 0) << std::endl;

    long long ret = std::min(calc_pos(1, 0), calc_neg(N, 0) + N);

    //std::cout << "check:" << calc_pos(1, 0) << " " << calc_neg(N, 0) << " " << ret << std::endl;

    for (int i = 2; i <= N; i++) {
        ret = std::min(ret, calc_pos(i, 0) + calc_neg(i-1, 0) + i - 1);
    }

    std::cout << ret << std::endl;
    return 0;
}


Measured memory_bytes: 118144