import java.util.*

fun addOne(tree:TreeMap<Int,Int>,key:Int) = tree.put(key,(tree[key]?:0)+1)
fun removeOne(tree:TreeMap<Int,Int>,key:Int) = if(tree[key]==1)tree.remove(key) else tree.put(key,tree[key]!!-1)
fun readList() = readLine()!!.split(" ").map{it.toInt()}
fun main(args:Array<String>){
  val (N,M) = readList()
  val A = readList()
  val T = TreeMap<Int,Int>()
  var answer = 0L
  for(x in A){
    addOne(T,x)
  }
  for(i in 0 until M){
    val x = T.lastKey()
    removeOne(T,x)
    addOne(T,(x/2).toInt())
  }
  T.forEach{answer += it.key.toLong()*it.value.toLong()}
  println(answer)
}