DBG = !true
n = gets.to_i
a = gets.split.map{|z| z.to_i}
tol = Array.new(n)
tor = Array.new(n)
tol[0] = 1
1.upto(n-1) { |i|
  tol[i] = 1 + tol[i-1]
  if a[i-1] < a[i]
    ex = 0
    x = a[i-1]
    y = a[i]
    while x < y
      x *= 4
      ex += 2
    end
    tol[i] += ex * i
  end
}
print tol if DBG
puts "" if DBG

tor[n-1] = 0
(n-2).downto(0) { |i|
  tor[i] = tor[i+1]
  if a[i] > a[i+1]
    ex = 0
    x = a[i+1]
    y = a[i]
    while x < y
      x *= 4
      ex += 2
    end
    tor[i] += ex * (n-i-1)
  end
}
print tor if DBG
puts "" if DBG

mn = [tor[0], tol[n-1]].min
for i in 1..(n-1)
  s = tol[i-1] + tor[i]
  mn = s if s < mn
end
print mn
