import java.util.*


fun calc141D(N: Int, M: Int, A: List<Int>): Long {
    val queue= PriorityQueue(A.map { -it })

    for (i in 1..M){
        val m = queue.poll()
        queue.add(m/2)
    }
    return -queue.map { it.toLong() }.sum()
}


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