import java.util.PriorityQueue
import kotlin.comparisons.compareByDescending
fun main(args: Array<String>) {
    var (N, M) = listOfInt()
    val A = listOfLong()
    val Q = PriorityQueue<Long>(N, compareByDescending { it })
    for (n in 0 until N) {
        Q.add(A[n])
    }
    while (M > 0) {
        val e = Q.poll()!!
        Q.add(e / 2)
        M--
    }
    var ans = 0L
    while (Q.size > 0) {
        ans += Q.poll()!!
    }
    println(ans)
}
fun next() = readLine()!!
fun listOfString() = next().split(" ")
fun listOfInt(delta: Int = 0) = listOfString().map { Integer.parseInt(it) + delta }
fun listOfLong(delta: Long = 0L) = listOfString().map { java.lang.Long.parseLong(it) + delta }