n = gets.to_i
a = gets.split.map(&:to_i)

dpp,dpn = 2.times.map{Array.new(n,0)}

b = [[n-1,10**9]]
f = a[-1]
(n-2).downto(0) do |i|
    if f >= a[i]
        dpp[i] = dpp[i+1]
        j = 0
        while a[i]*(4**(j+1)) <= f
            j += 1
        end
        b.push([i,j]) if j > 0
    else
        dpp[i] = dpp[i+1]
        j = 0
        while f*(4**j) < a[i]
            j += 1
        end
        while j > 0
            if b[-1][1] >= j
                dpp[i] += (b[-1][0]-i)*2*j
                b[-1][1] -= j
                j = 0
                b.pop if b[-1][1] == 0
            else
                dpp[i] += (b[-1][0]-i)*2*j
                j -= b[-1][1]
                b.pop
            end
        end
    end
    f = a[i]
end
dpp.push(0)

b = [[0,10**9]]
f = -a[0]*2
dpn[0] = 1
for i in 1..n-1
    if f <= -a[i]*2
        dpn[i] = dpn[i-1]+1
        j = 0
        while f <= -a[i]*2*(4**(j+1))
            j += 1
        end
        b.push([i,j]) if j > 0
    else
        dpn[i] = dpn[i-1]+1
        j = 0
        while f*(4**j) > -a[i]*2
            j += 1
        end
        while j > 0
            if b[-1][1] >= j
                dpn[i] += (i-b[-1][0])*2*j
                b[-1][1] -= j
                j = 0
                b.pop if b[-1][1] == 0
            else
                dpn[i] += (i-b[-1][0])*2*j
                j -= b[-1][1]
                b.pop
            end
        end
    end
    f = -a[i]*2
end
dpn.unshift(0)

ans = dpp[0]+dpn[0]
for i in 1..n
    ans = dpp[i]+dpn[i] if ans > dpp[i]+dpn[i]
end
puts ans