import java.util.*

fun main(args: Array<String>) {
    solve(java.util.Scanner(System.`in`))
}

fun solve(sc: java.util.Scanner) {
    val N = sc.nextInt()
    val M = sc.nextInt()
    val A = Array(N) { sc.nextLong() }

    val q = PriorityQueue<Long>(N) { x, y -> return@PriorityQueue if (y > x) 1 else -1 }
    q.addAll(A.toList())
    var m = M
    while (m > 0) {
        val a = q.first()!!
        q.remove(a)
        q.add(a / 2)
        m--
    }
    println(q.sum())
}
