//#define NDEBUG
#include <cstddef>
#include <cstdint>
#include <vector>

using i8 = ::std::int_least8_t;
using i32 = ::std::int_least32_t;
using i64 = ::std::int_least64_t;
using u8 = ::std::uint_least8_t;
using u32 = ::std::uint_least32_t;
using u64 = ::std::uint_least64_t;
using isize = ::std::ptrdiff_t;
using usize = ::std::size_t;

template <class T = usize> class rep {
	const T f, l;

public:
	class itr {
		friend rep;
		T i;
		constexpr itr(T x) noexcept : i(x) {}

	public:
		void operator++() noexcept { ++i; }
		constexpr T operator*() const noexcept { return i; }
		constexpr bool operator!=(const itr x) const noexcept { return i != x.i; }
	};
	constexpr rep(const T first, const T last) noexcept : f(first), l(last) {}
	constexpr itr begin() const noexcept { return itr(f); }
	constexpr itr end() const noexcept { return itr(l); }
};
template <class T = usize> class revrep {
	const T f, l;

public:
	class itr {
		friend revrep;
		T i;
		constexpr itr(T x) noexcept : i(x) {}

	public:
		void operator++() noexcept { --i; }
		constexpr T operator*() const noexcept { return i; }
		constexpr bool operator!=(const itr x) const noexcept { return i != x.i; }
	};
	constexpr revrep(const T first, const T last) noexcept : f(first), l(last) {}
	constexpr itr begin() const noexcept { return itr(l - 1); }
	constexpr itr end() const noexcept { return itr(f - 1); }
};
template <class T> bool amax(T &a, const T &b) {
	return a <= b ? (a = b, 1) : 0;
}
template <class T> bool amin(T &a, const T &b) {
	return b <= a ? (a = b, 1) : 0;
}
template <class T> bool samax(T &a, const T &b) {
	return b <= a ? 0 : (a = b, 1);
}
template <class T> bool samin(T &a, const T &b) {
	return a <= b ? 0 : (a = b, 1);
}
template <class T> using vec_alias = ::std::vector<T>;
template <class T> auto md_vec(usize n, const T &value) {
	return ::std::vector<T>(n, value);
}
template <class... Args> auto md_vec(usize n, Args... args) {
	return ::std::vector<decltype(md_vec(args...))>(n, md_vec(args...));
}
template <class T> const T &as_const(const T &v) noexcept { return v; }
template <class T> constexpr T difference(const T &a, const T &b) {
	return a <= b ? b - a : a - b;
}

#include <cstddef>

template <class T> T power(T x, u64 exp) {
	T ret = 1;
	while (exp) {
		if (exp & 1)
			ret *= x;
		exp >>= 1;
		x *= x;
	}
	return ret;
}


#include <algorithm>
#include <iostream>
#include <utility>
#include <cmath>
#include <limits>
#include <stack>

int main() {
	usize n;
	::std::cin >> n;
	::std::vector<u64> a(n);
	for (auto &e : a) {
		::std::cin >> e;
	}
	::std::vector<u64> pos(n + 1), neg(n + 1);

	struct ar {
		u64 cnt;
		u64 dif;
	};
	::std::stack<ar> st;
	neg[0] = 0;
	neg[1] = 1;
	st.push({ 1, ::std::numeric_limits<u64>::max()/2 });
	for (const auto i : rep<>(1, n)) {
		neg[i + 1] = neg[i] + 1;
		u64 prev = a[i - 1], cur = a[i];
		if (prev < cur * 4) {
			while (prev < cur) {
				prev *= 4;
				neg[i + 1] += st.top().cnt * 2;
				--st.top().dif;
				if (st.top().dif == 0) {
					const u64 temp = st.top().cnt;
					st.pop();
					st.top().cnt += temp;
				}
			}
			++st.top().cnt;
		}
		else {
			st.push({ 1, 0 });
			while (prev >= cur * 4) {
				cur *= 4;
				++st.top().dif;
			}
		}
	}
	st = ::std::stack<ar>();
	pos[n] = 0;
	pos[n - 1] = 0;
	st.push({ 1, ::std::numeric_limits<u64>::max() / 2 });
	for (const auto i : revrep<>(0, n - 1)) {
		pos[i] = pos[i + 1];
		u64 prev = a[i + 1], cur = a[i];
		if (prev < cur * 4) {
			while (prev < cur) {
				prev *= 4;
				pos[i] += st.top().cnt * 2;
				--st.top().dif;
				if (st.top().dif == 0) {
					const u64 temp = st.top().cnt;
					st.pop();
					st.top().cnt += temp;
				}
			}
			++st.top().cnt;
		}
		else {
			st.push({ 1, 0 });
			while (prev >= cur * 4) {
				cur *= 4;
				++st.top().dif;
			}
		}
	}


	u64 ans = ::std::numeric_limits<u64>::max();

	for (const auto i : rep<>(0, n + 1)) {
		samin(ans, neg[i] + pos[i]);
	}

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


Measured memory_bytes: 4992