import std.stdio, std.conv, std.string, std.range, std.algorithm, std.array, std.functional;
import std.container;

void main() {
  auto input = readln.split.to!(int[]);
  auto N = input[0], M = input[1];
  auto A = readln.split.to!(ulong[]);

  auto maxHeap = heapify(A);

  foreach(i; 0..M) {
    auto m = maxHeap.front();
    maxHeap.removeFront();
    maxHeap.insert(m / 2);
  }

  maxHeap.sum.writeln;
}