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

int main()
{
	int N, M;
	cin >> N >> M;
	priority_queue<int> pq;
	for (int i = 0; i < N; i++) {
		int A;
		cin >> A;
		pq.push(A);
	}
	while (M--) {
		auto v = pq.top(); pq.pop();
		pq.push(v / 2);
	}
	ll res = 0;
	while (!pq.empty()) {
		res += pq.top(); pq.pop();
	}
	cout << res << endl;
	return 0;
}
