"use strict"
const create = () => {
    const input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
    const res = {
        "list": input, "index": 0, "max": input.length,
        "hasNext": function() {return this.index < this.max},
        "next": function() { if (!this.hasNext()) {throw "ArrayIndexOutOfBoundsException";}else{return this.list[this.index++];}}
    };
    return res;
}
const o = create();
const next = () => o.next()
const nextInt = () => parseInt(o.next())
const nextStrArray = () => o.next().split(" ")
const nextIntArray = () => o.next().split(" ").map(el => parseInt(el))
const nextCharArray = () => o.next().split("")
const hasNext = () => o.hasNext()
const myout = (...x) => console.log(...x)

class PriorityQueue{
    heap
    constructor(){
        this.heap = []
    }
    push(x){
        let i = this.heap.length
        let j
        while(i){
            j = i-1 >>1
            if(this.heap[j] <= x) break
            this.heap[i] = this.heap[j]
            i = j
        }
        this.heap[i] = x
    }
    pop(){
        let r = this.heap[0]
        let x = this.heap.pop()
        let i = 0
        let k = this.heap.length >> 1
        let j 
        while(i<k){
            j = (i<<1) + 1
            if(this.heap[j+1] < this.heap[j]) ++j
            if(x<= this.heap[j]) break
            this.heap[i] = this.heap[j]
            i = j
        }
        if(this.heap.length) this.heap[i] = x
        return r
    }
    size(){
        return this.heap.length
    }
    top(){
        return this.heap[0]
    }
}

const Main = () => {
    let [N, M] = nextIntArray()
    const a = nextIntArray()
    a.sort((a,b) => b-a)
    let pq = new PriorityQueue()
    for(let i = 0;i<a.length;i++){
        pq.push(-a[i])
    }
    while(M>0){
        let tmp = -pq.pop()
        tmp = Math.floor(tmp/2)
        pq.push(-tmp)
        M--
    }
  let sum = 0
    while(pq.size()>0){
        sum += -pq.pop()
    }
    console.log(sum)
}
Main()

