object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt // 最初の数字を読み取る
  val m = sc.nextInt
  var list = Array.fill(n)(sc.nextInt) // nextIntがn回呼ばれる
  val num  = list.size-1

  list = list.sorted

  Range(0, m).foreach{ _ =>
    list(num) = list(num) / 2
    list = list.sorted
  }

  print(list.sum)
}