#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, M;
  cin >> N >> M;
  priority_queue<int> Q;
  for (int a; cin >> a;) Q.push(a);
  while (M--) {
    int q = Q.top();
    Q.pop();
    Q.push(q / 2);
  }
  long ans = 0;
  while (Q.size()) {
    ans += Q.top();
    Q.pop();
  }
  cout << ans << "\n";
}