import java.util.*

fun main(args: Array<String>) {
    abc141d()
}

fun abc141d() {
    val (n, m) = readLine()!!.split(" ").map { it.toInt() }
    val aList = readLine()!!.split(" ").map { it.toLong() }
        .toLongArray()

    val queue = PriorityQueue<Long>(n, Comparator { o1: Long, o2: Long -> if (o1 > o2) -1 else 1 })
    aList.forEach { queue.add(it) }

    repeat(m) {
        val max = queue.poll()
        val halved = max / 2

        queue.add(halved)
    }

    println(queue.sum())
}
