import java.util.*

fun main(args: Array<String>) {
    val (N, M) = readLine()!!.split(" ").map{it.toInt()}
    val A = readLine()!!.split(" ").map{it.toLong()}

    val Q = PriorityQueue<Long>(N, Comparator<Long> { a: Long, b: Long -> (b - a).toInt() })
    A.forEach { Q.add(it) }

    var m = M
    while (m > 0) {
        val p = Q.poll()

        Q.add(p / 2)

        m--
    }

    println(Q.sum())
}
