import java.util.*

fun main(args: Array<String>) {
    val (n, m) = readIntegerList()
    val alist = readLongList()
    val queue = PriorityQueue<Long>(alist.size) { a, b ->
        if (a == b) {
            0
        } else if (b - a > 0L) {
            1
        } else {
            -1
        }
    }
    for (i in alist) {
        queue.add(i)
    }

    repeat(m) {
        val max = queue.remove()
        queue.add(max / 2L)
    }
    println(queue.sum())
}


fun readInteger() = readLine()!!.toInt()
fun readLong() = readLine()!!.toLong()
fun readStringList() = readLine()!!.split(" ")
fun readIntegerList() = readStringList().map(String::toInt)
fun readLongList() = readStringList().map(String::toLong)
