import std.algorithm;
import std.array;
import std.container;
import std.conv;
import std.math;
import std.numeric;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void scan(T...)(ref T a) {
    string[] ss = readln.split;
    foreach (i, t; T) a[i] = ss[i].to!t;
}
T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

long calc(int m, int[] a) {
    auto pq = new MaxHeap;
    foreach (e; a) pq.insert(e);

    foreach (_; 0..m) {
        int x = pq.front; pq.popFront();
        pq.insert(x / 2);
    }

    long sum = 0;
    auto b = pq.array;
    foreach (e; b) sum += e;
    return sum;
}

void main() {
    int n, m; scan(n, m);
    auto a = readints;
    writeln(calc(m, a));
}

alias MaxHeap = BinaryHeap!(Array!int, "a < b");
