function Main(input) {
  input = input.split('\n');
  var i0 = input[0].split(' ');
  var N = i0[0];
  var M = i0[1];
  var An = input[1].split(' ').sort().reverse();

  var results = Sub(An, M);
  var sum = 0;
  for (var i = 0; i < results.length; i++) {
    sum += sum + results[i];
  }
  console.log(sum);
}
function Sub(An, j) {
	An = An.sort().reverse();
	if (j == 0) return An;
	An[0] = An[0] / Math.pow(2, j);
	return Sub(An, j -1);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
