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

void main() {
    int[] tmp = readln.chomp.split.to!(int[]);
    int n = tmp[0], m = tmp[1];
    long[] a = readln.chomp.split.to!(long[]);
    BinaryHeap!(long[]) h = heapify(a);
    foreach (i; 0 .. m) {
        long f = h.front / 2;
        h.removeFront;
        h.insert(f);
    }
    h.sum.writeln;
}