input = require('fs').readFileSync('/dev/stdin', 'utf8')
lines = input.split('\n')
line = lines.shift().split(' ')
N = line[0] * 1
K = line[1] * 1 
A = lines.shift().split(' ')

heap = [0]
_insertHeap = (v) => {
    var idx = heap.length
    while(idx > 1) {
        var parent = ~~(idx / 2)
        if (heap[parent] < v) {
            heap[idx] = heap[parent]
            idx = parent
        } else {
            break;
        }
    }
    heap[idx] = v
}

_popHeap = () => {
    var val = heap[1]
    var last = heap.pop()
    
    if (heap.length == 1) {
        return val
    }
    
    var idx = 1
    while(true) {
        var left = idx * 2
        var right = idx * 2 + 1
        var next = idx
        if (left < heap.length && heap[left] > last) {
          next = left
        }
        if (right < heap.length && heap[right] > last && heap[right] > heap[left]) {
          next = right
        }
        if (next != idx) {
          heap[idx] = heap[next]
          idx = next
        } else {
            break;
        }
    }
    heap[idx] = last
    return val
}

for(i=0; i<N; i++) {
    _insertHeap(A[i] * 1)
}

for(i=0; i<K; i++) {
    a = _popHeap()
    _insertHeap(~~(a / 2))
}

sum = 0
for(i=1; i<heap.length; i++) {
    sum += heap[i]
}

console.log(sum)