import java.util.*

fun main(args: Array<String>) = shojin06d()

fun shojin06d() {
    val (n, m) = readLine()!!.split(' ').map { it.toInt() }
    val aList = readLine()!!.split(' ').map { it.toLong() }

    val queue =
        PriorityQueue(aList.size, Comparator { o1: Long, o2: Long -> if (o2 > o1) 1 else if (o2 == o1) 0 else -1 })
    queue.addAll(aList)

    repeat(m) {
        val poll = queue.poll()
        queue.add(poll / 2)
    }

    val answer = queue.sum()

    println(answer)
}
