#include <stdio.h>
#include <stdlib.h>

static int *heap;
static int hn;

static void push(int x)
{
    int i = hn++;
    heap[i] = x;
    while(i > 0)
	{
        int p = (i-1)/2;
        if(heap[p] >= heap[i]) break;
        int t = heap[p]; heap[p] = heap[i]; heap[i] = t;
        i = p;
    }
}

static int pop(void)
{
    int ret = heap[0];
    int i = 0;
    heap[0] = heap[--hn];
    while(1)
	{
        int l = 2*i+1, r = 2*i+2, m = i;
        if(l < hn && heap[l] > heap[m]) m = l;
        if(r < hn && heap[r] > heap[m]) m = r;
        if(m == i) break;
        int t = heap[m]; heap[m] = heap[i]; heap[i] = t;
        i = m;
    }
    return ret;
}

int solve()
{
    int ret;
    int n, q, i, x;
    scanf("%d %d", &n, &q);
    heap = (int *)malloc(sizeof(int) * n);
    hn = 0;
    for(i = 0; i < n; i++)
	{
        scanf("%d", &x);
        push(x);
    }
    for(i = 0; i < q; i++)
	{
        if(heap[0] == 0) break;
        x = pop();
        push(x/2);
    }
    ret = 0;
    for(i = 0; i < hn; i++) ret += heap[i];
    free(heap);
    return ret;
}


int main(void)
{
    printf("%d\n",solve());
    return 0;
}