#include <iostream>
#include <queue>
using namespace std;
 
   int main()
   {
        std::priority_queue<int> pq;
       int n, m;
        cin >> n >> m;
        for (int i = 0; i < n; i++) {
            int x;
            cin >> x;
            pq.push(x);
        }
        
        unsigned long long int sum = 0;
        while (!pq.empty()) {
            int t = pq.top();
            pq.pop();
            if(m > 0) {
                t = t / 2;
                pq.push(t);
                m--;
            } else {
                sum += t;
            }
        }
        
        cout<< sum << endl;
        return 0;
    }