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

signed main(){
    int N,M; cin>>N>>M;
    priority_queue<int> Q;
    int ans=0;
    for(int i=0;i<N;i++){
        int a; cin>>a;
        Q.push(a);
        ans+=a;
    }

    while(M--){
        int t=Q.top(); Q.pop();
        ans-=t-t/2;
        Q.push(t/2);
    }
    cout<<ans<<endl;
    return 0;
}