import heapq

import math

#これを加える！！！！

def _heappush_max(heap, item):

    heap.append(item)

    heapq._siftdown_max(heap, 0, len(heap)-1)

def _heappop_max(heap):

    """Maxheap version of a heappop."""

    lastelt = heap.pop()    # raises appropriate IndexError if heap is empty

    if heap:

        returnitem = heap[0]

        heap[0] = lastelt

        heapq._siftup_max(heap, 0)

        return returnitem

    return lastelt



"""

a = [1,7,3,5,4]



#heapify

#配列a = [1,7,3,5,4]をheapにする

heapq._heapify_max(a)

print(a) #[7, 5, 3, 1, 4]



#heappop

#最大値の取り出し

print(_heappop_max(a)) #7

print(a) #[5, 4, 3, 1]



#heappush

#要素(2)の挿入

_heappush_max(a,2)

print(a) #[5, 4, 3, 1, 2]



#最大値の取り出し

print(_heappop_max(a)) #5

"""



N, M = list(map(int, input().split()))

a = [int(i) for i in input().split()]

heapq._heapify_max(a)



for j in range(M):

    _heappush_max(a, _heappop_max(a)//2)

print((sum(a)))

import heapq



n, m = list(map(int, input().split()))

a = list([int(x)*(-1) for x in input().split()])

heapq.heapify(a)  # aを優先度付きキューに



for _ in range(m):

    tmp_min = heapq.heappop(a)

    heapq.heappush(a, (-1)*(-tmp_min//2))  # 計算誤差の関係で-1を2回かけてます

print((-sum(a)))
import heapq
import math

# これを加える！！！！
def _heappush_max(heap, item):
    heap.append(item)
    heapq._siftdown_max(heap, 0, len(heap) - 1)


def _heappop_max(heap):
    """Maxheap version of a heappop."""
    lastelt = heap.pop()  # raises appropriate IndexError if heap is empty
    if heap:
        returnitem = heap[0]
        heap[0] = lastelt
        heapq._siftup_max(heap, 0)
        return returnitem
    return lastelt


"""
a = [1,7,3,5,4]
#heapify
#配列a = [1,7,3,5,4]をheapにする
heapq._heapify_max(a)
print(a) #[7, 5, 3, 1, 4]
#heappop
#最大値の取り出し
print(_heappop_max(a)) #7
print(a) #[5, 4, 3, 1]
#heappush
#要素(2)の挿入
_heappush_max(a,2)
print(a) #[5, 4, 3, 1, 2]
#最大値の取り出し
print(_heappop_max(a)) #5
"""
N, M = list(map(int, input().split()))
a = [int(i) for i in input().split()]
heapq._heapify_max(a)
for j in range(M):
    _heappush_max(a, _heappop_max(a) // 2)
print((sum(a)))

import heapq

n, m = list(map(int, input().split()))
a = list([int(x) * (-1) for x in input().split()])
heapq.heapify(a)  # aを優先度付きキューに
for _ in range(m):
    tmp_min = heapq.heappop(a)
    heapq.heappush(a, (-1) * (-tmp_min // 2))  # 計算誤差の関係で-1を2回かけてます
print((-sum(a)))

-import math -# これを加える！！！！ -def _heappush_max(heap, item): -    heap.append(item) -    heapq._siftdown_max(heap, 0, len(heap) - 1) - - -def _heappop_max(heap): -    """Maxheap version of a heappop.""" -    lastelt = heap.pop()  # raises appropriate IndexError if heap is empty -    if heap: -        returnitem = heap[0] -        heap[0] = lastelt -        heapq._siftup_max(heap, 0) -        return returnitem -    return lastelt - - -""" -a = [1,7,3,5,4] -#heapify -#配列a = [1,7,3,5,4]をheapにする -heapq._heapify_max(a) -print(a) #[7, 5, 3, 1, 4] -#heappop -#最大値の取り出し -print(_heappop_max(a)) #7 -print(a) #[5, 4, 3, 1] -#heappush -#要素(2)の挿入 -_heappush_max(a,2) -print(a) #[5, 4, 3, 1, 2] -#最大値の取り出し -print(_heappop_max(a)) #5 -""" -N, M = list(map(int, input().split())) -a = [int(i) for i in input().split()] -heapq._heapify_max(a) -for j in range(M): -    _heappush_max(a, _heappop_max(a) // 2) -print((sum(a))) +n, m = list(map(int, input().split())) +a = list([int(x) * (-1) for x in input().split()]) +heapq.heapify(a)  # aを優先度付きキューに +for _ in range(m): +    tmp_min = heapq.heappop(a) +    heapq.heappush(a, (-1) * (-tmp_min // 2))  # 計算誤差の関係で-1を2回かけてます +print((-sum(a)))