import java.util.*

fun main(args: Array<String>) {
    val sc = java.util.Scanner(System.`in`)
    val n = sc.nextInt()
    val m = sc.nextInt()

    val pq: PriorityQueue<Long> = PriorityQueue(n, Collections.reverseOrder())
    sc.asSequence().take(n).map(String::toLong).toCollection(pq)

    (1..m).asSequence().forEach {
        val x = pq.poll()
        pq.add(x / 2)
    }
    println(pq.asSequence().sum())
}
