#!/usr/bin/env python3



from bisect import insort_right



n, m, *a = list(map(int, open(0).read().split()))

a.sort()

for _ in range(m):

    insort_right(a, a.pop() >> 1)

print((sum(a)))

#!/usr/bin/env python3



import heapq



n, m, *a = list(map(int, open(0).read().split()))



a = [*[-x for x in a]]

heapq.heapify(a)

for _ in range(m):

    heapq.heappush(a, -(-heapq.heappop(a) >> 1))

print((-sum(a)))

#!/usr/bin/env python3
from bisect import insort_right

n, m, *a = list(map(int, open(0).read().split()))
a.sort()
for _ in range(m):
    insort_right(a, a.pop() >> 1)
print((sum(a)))

#!/usr/bin/env python3
import heapq

n, m, *a = list(map(int, open(0).read().split()))
a = [*[-x for x in a]]
heapq.heapify(a)
for _ in range(m):
    heapq.heappush(a, -(-heapq.heappop(a) >> 1))
print((-sum(a)))

-from bisect import insort_right +import heapq -a.sort() +a = [*[-x for x in a]] +heapq.heapify(a) -    insort_right(a, a.pop() >> 1) -print((sum(a))) +    heapq.heappush(a, -(-heapq.heappop(a) >> 1)) +print((-sum(a)))