import java.util.*

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

    A.forEach {
        maxHeap.add(it * -1)
    }


    while (M > 0) {
        val max = maxHeap.poll() * -1
        maxHeap.add( max / 2 * -1)
        M--
    }

    var sum =0L
    while (!maxHeap.isEmpty()) {
        sum += maxHeap.poll() * -1
    }

    println(sum)
}