import scala.io.StdIn
import scala.math._
object Main extends App {
  val List(n,m) = StdIn.readLine().split(" ").map(_.toInt).toList
  var a = StdIn.readLine().split(" ").map(_.toLong).sorted.reverse
  for (i <- 1 to m) {
    a(0) = ceil(a(0) / 2).toLong
    a = a.sorted(Ordering[Long].reverse)
  }
  println(a.sum)
}
