import java.math.BigInteger

fun main(args: Array<String>){
  var input = readLine()!!.split(" ")
  val N = input[0].toInt()
  val M = input[1].toInt()
  input = readLine()!!.split(" ")
  val A = Array(N){ input[it].toInt() }
  A.sortBy{ -it }

  var i = 0
  for( m in 1..M ){
    A[i] /= 2
    if( i == N-1 )
      i = 0
    else if( A[i] < A[i+1] )
      i++
    if( A[i] <= A[0] ){
      A.sortBy{ -it }
      i = 0
    }
  }

  var all = BigInteger.ZERO
  for( a in A )
    all = all.plus(BigInteger(a.toString()))
  println(all)
}
