#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  ll N,M; cin >> N >> M;
  priority_queue<ll> Q;
  for(ll i = 0; i < N; i++){ ll a; cin >> a; Q.push(a);}
  
  while(M--){
    ll b = Q.top(); Q.pop(); b /=2; Q.push(b);}
  ll ans = 0;

   while(!Q.empty()){
     ans += Q.top(); Q.pop();}
  cout << ans << endl; return 0;}
  