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

void main() {
  int N, M; readf("%d %d\n", &N, &M);
  auto An = readln.split.to!(ulong[]);

  foreach(t; 0..M) {
    auto HalfAn = An.map!(a => a - a/2);
    ulong max_discount = 0;
    ulong max_index = 0;
    foreach(i; 0..N) {
      if (max_discount >= HalfAn[i]) continue;
      max_index = i; max_discount = HalfAn[i];
    }
    An[max_index] = An[max_index]/2;
  }

  An.sum.writeln;
}
