object Main {
  def main(args: Array[String]): Unit = {
    solve
  }

  def solve(): Unit = {
    val sc = new java.util.Scanner(System.in)
    val n = sc.nextInt
    var m = sc.nextInt
    val as = new Array[Long](n)
    for (i <- 0 until n) {
      as(i) = sc.nextLong()
    }

    while (m > 0) {
      val max = as.max
      val maxIndex = as.indexOf(max)
      as(maxIndex) = max / 2
      m -= 1
    }

    println(as.sum)
  }
}
