import java.util.*

fun main(args: Array<String>) {
    val(n,m) = readLine()!!.split(" ").map(String::toInt)
    val a = readLine()!!.split(" ").map(String::toLong)
    val pq = PriorityQueue<Long>(n, Comparator { o1, o2 -> o2.compareTo(o1) })
    a.forEach{ i -> pq.add(i) }
    repeat (m) {
        pq.add(pq.poll()/ 2)
    }
    println(pq.sum())
}