#include<bits/stdc++.h>
using namespace std;
int n,m;
long long ans,x;
priority_queue<long long> pq;
int main()
{
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;++i) scanf("%lld",&x),pq.push(x);
	for(int i=1;i<=m;++i) {
		x=pq.top();
		pq.pop();
		pq.push(x/2);
	}
	for(int i=1;i<=n;++i) ans+=pq.top(),pq.pop();
	printf("%lld",ans);
	return 0;
}