'use strict';

function main(input) {
    const n = parseInt(input.shift());
    const m = parseInt(input.shift());
    const b = new BinaryHeap();
    for (var i = 0; i < n; i++) {
        b.push(parseInt(input.shift()));
    }
    for (var i = 0; i < m; i++) {
        b.push(Math.trunc(b.pop() / 2));
    }
    var sum = 0;
    for (var i = 0; i < n; i++) {
        sum += b.pop();
    }
    console.log(sum);
}

class BinaryHeap {
    static rotate(heap, idx) {
        const parent = Math.trunc(idx / 2);
        if (heap[parent] < heap[idx]) {
            const tmp = heap[idx];
            heap[idx] = heap[parent];
            heap[parent] = tmp;
            BinaryHeap.rotate(heap, parent);
        }
    }
    constructor() {
        this.heap = new Array(1); // first is unused
    }
    push(data) {
        BinaryHeap.rotate(this.heap, this.heap.push(data) - 1);
    }
    pop() {
        const data = this.heap[1];
        this.heap.copyWithin(1, 2).pop();
        return data;
    }
}

if (process.argv[1] == __filename) {
    const input = require('fs').readFileSync('/dev/stdin', 'utf-8').split(/\s/);
    main(input);
}
