import java.util.*

fun main(args: Array<String>) {
    val (N, M) = readLine()!!.split(" ").map(String::toInt)
    val A = readLine()!!.split(" ").map(String::toLong)
    val queue = PriorityQueue<Long>(N, Comparator { o1: Long?, o2: Long? -> if (o1!! > o2!!) -1 else 1 })
    queue.addAll(A)

    repeat(M) {
        queue.add(queue.poll() / 2)
    }
    println(queue.sum())
}