import core.bitop, std.bitmanip;
import core.checkedint;
import std.algorithm, std.functional;
import std.array, std.container;
import std.bigint;
import std.conv;
import std.math, std.numeric;
import std.range, std.range.interfaces;
import std.stdio, std.string;
import std.typecons;

void main()
{
    int n, m;
    readf("%s %s", &n, &m);
    readln;
    
    auto arr = readln.chomp.split.map!(to!int).array;
    
    auto rbt = make!(RedBlackTree!(int, "a > b", true))(arr);
    
    while (m--) {
        auto x = rbt.front;
        
        rbt.removeFront();
        
        rbt.insert(x / 2);
    }
    
    long ans = 0;
    foreach (e; rbt) { ans += e; }
    
    ans.writeln;
}