import scala.io.StdIn
object Main extends App {
  val List(n,m) = StdIn.readLine().split(" ").map(_.toInt).toList
  var a = new scala.collection.mutable.PriorityQueue[Long]()
  StdIn.readLine().split(" ").foreach(n => a += n.toLong)
  for (i <- 0 to m-1) a += a.dequeue() / 2
  println(a.toArray.sum)
}
