import java.util.*

fun main(args: Array<String>) {
    val (n, m) = readLine()?.split(" ")?.map(String::toInt) ?: return
    val a = readLine()?.split(" ")?.map(String::toLong) ?: return
    val queue = PriorityQueue<Long>(n, Comparator { o1, o2 -> (o2 - o1).toInt() })
    queue.addAll(a)
    repeat(0.until(m).count()) {
        val f = queue.poll() / 2
        queue.offer(f)
    }

    println(queue.sum().toString())
}

