#include <bits/stdc++.h>
using namespace std;
int main()
{
    freopen("1.txt", "r", stdin);
    int n, k, x;
    scanf("%d%d", &n, &k);
    priority_queue<int> hp;
    for (int i = 0; i < n; i++)
        scanf("%d", &x), hp.push(x);
    while (k--)
    {
        x = hp.top();
        hp.pop();
        hp.push(x >> 1);
    }
    long long ans = 0;
    for (int i = 0; i < n; i++)
        ans += hp.top(), hp.pop();
    printf("%lld", ans);
    return 0;
}