#include<bits/stdc++.h>
#define ll long long
#define mod 1000000007
//priority_queue 优先队列 
typedef unsigned long long ull;
const int INF=0x3f3f3f3f;
const int N=2e5+5;
using namespace std;
const int b=13331;//质数 

int n,m;
int dp[N]={0}; 
ll t,sum=0;
priority_queue <ll> s;
int main(){
    cin>>n>>m;
    for(int i=0;i<n;i++){
    	cin>>t;
    	s.push(t);
	}
	while(m&&!s.empty()){
		ll a=s.top();
		m--;
		s.pop();
		s.push(a/2);
	}
	while(!s.empty()){
		ll a=s.top();
		sum+=a;
		s.pop();
	}
	cout<<sum<<endl;
    return 0;
}
