import java.util.*
import kotlin.comparisons.reverseOrder

fun main(args: Array<String>) {
    val (n, m) = readLine()!!.split(' ').map(String::toInt)
    val array = readLine()!!.split(' ').map(String::toLong)
    val pq = PriorityQueue<Long>(n, reverseOrder())
    pq.addAll(array)
    repeat(m) {
        val num = pq.poll() / 2
        pq.add(num)
    }
    println(pq.sum())
}
