class SkewQ {
  constructor(v,r,l) {
    this.h = {v,r,l};
  }
  static meld(a,b) {
    if ( a === void 0 ) return b;
    if ( b === void 0 ) return a;
    if ( a.v < b.v ) [a,b] = [b,a];
    a.r = SkewQ.meld(a.r,b);
    [a.r,a.l] = [a.l,a.r];
    return a;
  }
  pop(){
    const v = this.h.v;
    this.h = SkewQ.meld(this.h.r,this.h.l);
    return v;
  }
  push(v,r,l){
    const b = {v,r,l};
    this.h = SkewQ.meld(this.h,b);
  }
}
console.log((args=>{
  const [[N,M],A] = args.trim().split`\n`.map(r=>r.split` `.map(v=>v|0));
  const q = new SkewQ(A[0]);
  for ( let i = 1; i < N; i++ ) q.push(A[i]);
  for ( let i = 0; i < M; i++ ) q.push( q.pop()>>1 );
  let s = 0;
  for ( let i = 0; i < N; i++ ) s += q.pop();
  return s;
})(require('fs').readFileSync('/dev/stdin', 'utf8')));
