import java.util.*
import kotlin.comparisons.compareValues

fun main(args: Array<String>) {
    data class Price(val p: Int) : Comparable<Price> {
        override fun compareTo(other: Price): Int {
            return compareValues(other.p, p)
        }

    }

    val scanner = Scanner(System.`in`)
    val n = scanner.nextInt()
    val m = scanner.nextInt()
    val a = IntArray(n) { scanner.nextInt() }

    val pq = PriorityQueue<Price>()
    a.forEach { pq.add(Price(it)) }

    (1..m).forEach {
        val p = pq.poll()
        pq.add(Price(p.p / 2))
    }

    val ret = pq.map { it.p.toLong() }.sum()


    println(ret)
}