class HeapQ {
  constructor( comp = (a,b)=>a>b ) {
    this.a = [];
    this.comp = comp;
  }
  get size(){ return this.a.length; }
  push( v ) {
    const {a,comp} = this;
    let i = a.push(v)-1, j = i;
    while ( i = j ) {
      j = (i-1)>>1;
      if ( comp( a[i], a[j]) ) [a[i],a[j]] = [a[j],a[i]];
      else break;
    }
  }
  pop(){
    const {a,comp} = this, N = a.length-1;
    const out = a[0];
    if ( N === 0 ) return a.pop();
    a[0] = a.pop();
    let i = 0, j;
    while ( (j=i+i+1) < N ) {
      if ( j+1 < N && comp(a[j+1], a[j]) ) j++;
      if ( comp(a[j], a[i]) ) [a[i],a[j]] = [a[j],a[i]];
      i = j;
    }
    return out;
  }
}

console.log((args=>{
  const [[N,M],A] = args.trim().split`\n`.map(r=>r.split` `.map(v=>v|0));
  const q = new HeapQ();
  for ( let i = 0; i < N; i++ ) q.push(A[i]);
  for ( let i = 0; i < M; i++ ) {
    let c = Math.floor( q.pop() / 2 );
    q.push(c);
  }
  return q.a.reduce((a,b)=>a+b,0);
})(require('fs').readFileSync('/dev/stdin', 'utf8')));
