#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define mp make_pair
#define mt make_tuple
#define ll long long
#define eb emplace_back
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)
#define scanVec(vec , n) for(int i = 0; i < n ; i++){ cin>>vec[i];}
#define printVec(vec , n) for(int i = 0; i < n ; i++){ cout<<vec[i]<<" ";}
#define mod(a,b) ((a%b +b)%b)
#define bit(x,i) (x&(1<<i))  //select the bit of position i of x
#define lowbit(x) ((x)&((x)^((x)-1))) //get the lowest bit of x
#define hBit(msb,n) asm("bsrl %1,%0" : "=r"(msb) : "r"(n)) //get the highest bit of x, maybe the fastest
#define max(a,b) (a<b?b:a)
#define min(a,b) (a>b?b:a) 
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
#define IN(i,l,r) (l<i&&i<r)
#define LINR(i,l,r) (l<=i&&i<=r)
#define LIN(i,l,r) (l<=i&&i<r)
#define INR(i,l,r) (l<i&&i<=r)
#define lastEle(vec) vec[vec.size()-1] 
#define SZ(x) ((int)((x).size()))
#define FOREACH(i,t) for (typeof(t.begin()) i=t.begin(); i!=t.end(); i++) 
#define ll long long 
#define ull unsigned long long
#define ui unsigned int
#define us unsigned short
#define INF 1001001001
#define PI 3.1415926535897932384626
 
using namespace std;
 using namespace __gnu_pbds;
 template <typename T>
 using ordered_set =
    tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
 
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
 
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cerr << *it << " = " << a << endl;
    err(++it, args...);
}
 
//----------------------------------------------------------------------------------------------------------------------
 
#define p 101 
#define MOD 1000000007 
  
void swap(int &a, int & b){
    int temp = a;
    a = b;
    b = temp;
 
}
 
 
    //     ll l = -1,  r  = exp;
    // ll ans = exp + 50;
    // while (l + 1 < r) {
    //     ll c = (l + r) / 2;
    //     if ( str + c > in + (exp - c) ){
    //         ans = min(ans,c);
    //         r = c;
    //     }else{
    //         l = c;
    //     }
    // }
 
char graph[5005][50005];
vector<bool> used;
int n;
int first,second,third;
 
void dfs( int root, int grandFather, int father ){
    used[root] = true;
    for(int i = 0;i < n;i++){
        if(graph[root][i] == '1'){
            if(grandFather == i){
                first = grandFather; second = father; third = root;
                return;
            }
            if(!used[i]){
                dfs(i,father,root);
            }
 
        }
    }
}
 
 
int main() {
   ll n,m; cin >> n >> m;
   multiset<ll> items;
   for(int i = 0;i < n;i++){
       ll a; cin >> a;
       items.insert(a);
   }
   for(int i = 0;i < m;i++){
       ll mx = *(--items.end());
       items.erase((--items.end()));
       items.insert(mx/2);
   }
   ll sum = 0;
   for(ll curr : items){
       sum+= curr;
   }
   cout << sum << endl;
    
   return 0; 
} 


Measured memory_bytes: 4992