import scala.collection.mutable
import scala.io.StdIn
import java.util._

object Main extends App {
  val l = StdIn.readLine().split(" ").map(_.toInt)
  val n = l(0)
  val m = l(1)

  var q = new java.util.PriorityQueue[Long](new Comparator[Long]() {
    def compare(lhs: Long, rhs: Long): Int = {
      if (lhs < rhs) return +1
      if (lhs.equals(rhs)) return 0
      -1
    }
  });
  StdIn.readLine().split(" ").foreach(i => q.add(i.toLong))
  for (i <- 0 until m){
    q.add(q.poll()/2)
  }
  println(q.toArray.reduceRight(_.asInstanceOf[Long] + _.asInstanceOf[Long]))
}
