#include <bits/stdc++.h>

using namespace std;

const int max_n = 200222;
const long long inf = 1000111222000111222LL;

int n, a[max_n];
long long pref[max_n], suf[max_n];
long long pref2[max_n], suf2[max_n];

void calc(long long res[max_n]) {
    res[n + 1] = 0;
    res[n] = 0;
    stack<pair<int, long long>> st;
    st.push({n + 1, -inf});
    for (int i = n - 1; i > 0; --i) {
        long long x = a[i + 1];
        int cnt = 0;
        while (a[i] > x) {
            x *= 4;
            ++cnt;
        }
        if (cnt == 0) {
            long long y = a[i];
            while (y * 4 <= x) {
                --cnt;
                y *= 4;
            }
        }
        res[i] = res[i + 1];
        if (cnt >= 0) {
            int l = i + 1;
            while (cnt) {
                pair<int, long long> p = st.top();
                //cout << i << ": " << cnt << " " << l << " (" << p.first << " " << p.second << ")" << endl;
                res[i] += cnt * (p.first - l);
                st.pop();
                p.second += cnt;
                if (p.second < 0) {
                    st.push(p);
                    break;
                } else {
                    l = p.first;
                    cnt = p.second;
                }
            }
        } else {
            st.push({i + 1, cnt});
        }
    }

    for (int i = 1; i < n; ++i) {
        res[i] *= 2;
    }
}

bool bad(long long x, long long y, int k, int k2) {
    int mn = min(k, k2);
    k -= mn;
    k2 -= mn;
    if (k) {
        while (k--) {
            x *= 4;
            if (x > y) {
                return true;
            }
        }
        return false;
    }
    while (k2--) {
        y *= 4;
        if (x <= y) {
            return false;
        }
    }
    return x > y;
}

void calc_triv(long long res[max_n]) {
    for (int i = 1; i <= n; ++i) {
        long long cnt = 0, k = 0;
        for (int j = i + 1; j <= n; ++j) {
            long long k2 = 0;
            while (bad(a[j - 1], a[j], k, k2)) {
                ++k2;
            }
            k = k2;
            cnt += 2 * k2;
        }
        res[i] = cnt;
    }
}

const bool debug = false;

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i) {
        scanf("%d", &a[i]);
    }

    calc(suf);
    if (debug) {
        calc_triv(suf2);
        for (int i = 1; i <= n + 1; ++i) {
            cout << i << ": " << suf[i] << " " << suf2[i] << endl;
        }
        cout << endl;
        //return 2;
    }

    for (int i = 1; i <= n; ++i) {
        a[i] *= 2;
    }
    reverse(a + 1, a + n + 1);
    calc(pref);
    reverse(pref + 1, pref + n + 2);
    for (int i = 0; i < n + 1; ++i) {
        pref[i] = pref[i + 1] + i;
    }
    if (debug) {
        calc_triv(pref2);
        reverse(pref2 + 1, pref2 + n + 2);
        for (int i = 0; i < n + 1; ++i) {
            pref2[i] = pref2[i + 1] + i;
        }
        for (int i = 0; i <= n; ++i) {
            cout << i << ": " << pref[i] << " " << pref2[i] << endl;
        }
        for (int i = 0; i <= n + 1; ++i) {
            if (pref[i] != pref2[i]) {
                exit(228);
            }
            if (suf[i] != suf2[i]) {
                exit(229);
            }
        }
        return 0;
    }

    long long ans = inf;
    for (int i = 0; i <= n; ++i) {
        ans = min(ans, pref[i] + suf[i + 1]);
        //cout << i << ": " << pref[i] << " " << suf[i + 1] << endl;
    }
    printf("%lld\n", ans);
    return 0;
}


Measured memory_bytes: 5248