var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split("\n");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]==="string")s[y]=s[y].split(" ").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(" ");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(" "));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();
var o=GET(require("fs").readFileSync("/dev/stdin","utf8"));

console.log(main());
function main(){
  var n = o.a();
  var a = o.l();
  var b = [0], c = [];
  var t;
  c[n-1] = 0;
  for(var i = 1; i < n; i++){
    b[i] = 0, c[i-1] = 0;
    if(a[i] > a[i-1]){
      t = a[i-1] * 4, c[i-1]++;
      while(t <= a[i]){if(t < a[i])c[i-1]++; t *= 4; b[i]--;}
    }else{
      t = a[i];
      while(a[i-1] > t){t *= 4; b[i]++; if(a[i-1] >= t)c[i-1]--;}
    }
  }
  var l = 0, r = n-1, la = f(l), ra = f(r);
  while(l < r - 1){
    var ml = (l+l+r+1) / 3 | 0;
    var mr = (l+r+r) / 3 | 0;
    var mla = f(ml), mra = f(mr);
    if(mla > mra)l = ml, la = mla;
    else r = mr, ra = mra;
  }
  return Math.min(la, ra);

  function f(x){
    var r = 0, t = 0;
    for(var i = x+1; i < n; i++){
      t = Math.max(0, t + b[i]);
      r += t;
    }
    t = 0;
    for(i = x-1; i >= 0; i--){
      t = Math.max(0, t + c[i]);
      r += t;
    }
    return x + r * 2;
  }
}