#include <iostream>
#include <set>
using namespace std;
multiset<int, greater<int> > a;
long long n, m, b, k, i;
signed main()
{
    cin >> n >> m;
    for (i = 0; i < n; i++) cin >> k, a.insert(k);
    for (i = 0; i < m; i++) a.insert((*a.begin()) / 2), a.erase(a.begin());
    for (auto c : a) b += c;
    cout << b;
}