import java.util.*

fun main(args: Array<String>) {
    val (n, m) = readLine()!!.split(" ").map { it.toLong() }
    val a = readLine()!!.split(" ").map { -it.toLong()}

    var q = PriorityQueue(a)
    for (i in 0 until m){
        q.add(q.poll()/2)
    }
    println(-q.sum())
}

