#include <bits/stdc++.h>
using namespace std;
int a[100001];
int main() {
	int n,m;
	cin>>n>>m;
	int x;
	priority_queue<int>q;
	for(int i=0;i<n;i++)
	{
		cin>>x;
		q.push(x);
	}
	int y;
	while(m>0)
	{
		y=q.top();
		q.pop();
		q.push(y/2);
		m--;
	}
	long long ans=0;
	while(!q.empty())
	{
		ans=ans+q.top();
		q.pop();
	}
	cout<<ans;
	return 0;
}