// Max Heap
class Heap<T : Comparable<T>> {
    private var heap: MutableList<T> = mutableListOf()
    val size: Int
        get() = this.heap.size

    fun push(elem: T) {
        var i = heap.size  // My node index
        heap.add(elem)    // Add element as last child

        while (i > 0) {
            val p = (i - 1) / 2   // My parent node
            if (heap[p] >= elem) break   // There is no reversal

            // Move parent to child
            heap[i] = heap[p]
            i = p
        }
        heap[i] = elem
    }

    fun pop(): T? {
        if (heap.size == 0) return null

        val ret = heap[0]   // Maximum
        val x = heap.last()  // Move last child to root
        heap.removeAt(heap.lastIndex)

        if(heap.size == 0) return ret

        var i = 0
        while (i * 2 + 1 < heap.size) {
            var a = i * 2 + 1   // Left child
            val b = i * 2 + 2   // Right child if exists

            if (b < heap.size && heap[b] > heap[a]) a = b  // Move bigger to left

            if (heap[a] <= x) break   // There is no reversal

            // Move child to parent
            heap[i] = heap[a]
            i = a
        }
        heap[i] = x

        return ret
    }
}

fun main(args: Array<String>){
    val(n, m) = readLine()!!.split(' ').map { it.toInt() }
    val items = Heap<Int>()
    readLine()!!.split(' ').map { items.push(it.toInt()) }

    repeat(m){
        items.push(Math.floor(items.pop()!! / 2.0).toInt())
    }

    var ans: Long = 0
    repeat(items.size){
        ans += items.pop()!!
    }

    println(ans)
}