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

//必要があれば，関数をいくつでも追加して良い
#define MAXN 200005
static int heap[MAXN];
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;
    //ここにプログラムを書く
    //ret に答えを入れてメイン関数に返す
    int n, q, i, x;
    scanf("%d %d", &n, &q);
    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];
    return ret;
}

//メイン関数はいじらなくて良い
int main(void){
    printf("%d\n",solve());
    return 0;
}