import collection.mutable.PriorityQueue

object Main {
  def main(args:Array[String]) = {
    val sc = new java.util.Scanner(System.in)
    val n, m = sc.nextInt
    val ar = Array.fill(n)(sc.nextLong)
    var q = new PriorityQueue[Long]()(Ordering.Long)
    ar.foreach{q+=_}
    for(i <- 1 to m) {
      val v = q.dequeue / 2
      q += v
    }
    var result = 0L
    q.foreach {
      result += _
    }
    println(result)
  }
}
