"use strict";

class PriorityQueue {
  constructor() {
    this.heap = [];
  }

  push(item) {
    let heap = this.heap;
    let i = heap.length++;
    let j;

    while(i) {
      j = i - 1 >> 1;
      if(heap[j] <= item) break;
      heap[i] = heap[j]
      i = j;
    }

    heap[i] = item;
  }

  pop() {
    let heap = this.heap;
    let r = heap[0];
    let x = heap.pop();

    let i = 0;
    let k = heap.length >> 1;
    let j;

    while(i < k) {
      j = (i << 1) + 1;
      if(heap[j+1] < heap[j]) ++j;

      if(x <= heap[j]) break;

      heap[i] = heap[j];

      i = j;
    }

    if(heap.length) {
      heap[i] = x;
    }

    return r;
  }

  size() {
    return this.heap.length;
  }

  top() {
    return this.heap[0];
  }
}


const main = arg => {
    arg = arg.trim().split("\n");
    const N = parseInt(arg[0].split(" ")[0]);
    const M = parseInt(arg[0].split(" ")[1]);
    
    const A = arg[1].split(" ").map(n=>parseInt(n)).sort((a,b)=>a-b);

    let pq = new PriorityQueue();
    
    for(let i in A) {
        pq.push(-A[i]);        
    }
    
    for(let i=0; i<M; i++) {
        let highest = -pq.pop();
        pq.push(-Math.floor(highest / 2));
    }
    
    let answer = -1 * pq.heap.reduce((m,n)=>m + n);

    console.log(answer);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
