"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 MaxHeap {
    arr
    constructor() {
        this.arr = []
    }
    build() {
        for (let i = this.arr.length - 1; i >= 0; i--) {
            this.heapify(i, this.arr.length)
        }
    }
    heapify(i, len) {
        let l = 2 * i + 1
        let r = 2 * i + 2
        let largest = i

        // Condition 'l <= len' & 'r <= len' is for the case of leaf nodes.
        // On leaf nodes, swap() should NOT happen so this condition skips these cases.
        if (l <= len && this.arr[l] > this.arr[i]) {
            largest = l
        }
        if (r <= len && this.arr[r] > this.arr[i]) {
            largest = r
        }
        if (largest !== i) {
            this.swap(i, largest)
            this.heapify(largest, len)
        }
    }
    swap(i, j) {
        [this.arr[i], this.arr[j]] = [this.arr[j], this.arr[i]]
    }
    push(data) {
        this.arr.push(data)
        this.build()
    }
    pop() {
        let elm = this.arr.shift()
        this.build()
        return elm
    }
}

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

