import java.util.*
import kotlin.math.acos
import kotlin.math.cos
import kotlin.math.round
import kotlin.math.sin

fun main(args: Array<String>) {
    val (n, m) = readIntList()
    val a = readIntList()

    val pq = PriorityQueue<Int>(Collections.reverseOrder())
    pq.addAll(a)
    repeat(m) {
        val max = pq.poll()
        pq.add(max / 2)
    }
    var sum = 0L
    pq.forEach { sum += it }
    println(sum)
}

// read
fun readString() = readLine()!!
fun readInt() = readLine()!!.toInt()
fun readLong() = readLine()!!.toLong()
fun readStringList() = readLine()!!.split(" ")
fun readIntList() = readLine()!!.split(" ").map(String::toInt)
fun readLongList() = readLine()!!.split(" ").map(String::toLong)