import heapq

n, m = map(int, input().split())
a = []

for i in input().split():
  heapq.heappush(a, -int(i))

for j in range(m):
  highest = heapq.heappop(a)
  heapq.heappush(a, -(-highest // 2))

print(-sum(a))
 import heapq heapq n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m a = [] a [] for i in input().split():
  heapq.heappush(a, -int(i)) i input().split() ().split () input split heapq.heappush(a, -int(i)) heapq.heappush heapq heappush a -int(i) int(i) int i for j in range(m):
  highest = heapq.heappop(a)
  heapq.heappush(a, -(-highest // 2)) j range(m) range m highest = heapq.heappop(a) highest heapq.heappop(a) heapq.heappop heapq heappop a heapq.heappush(a, -(-highest // 2)) heapq.heappush heapq heappush a -(-highest // 2) -highest // 2 -highest highest 2 print(-sum(a)) print -sum(a) sum(a) sum a n, m = map(int, input().split()) map(int, input().split()) n highest = heapq.heappop(a) heapq.heappop(a) highest m = map(int, input().split()) map(int, input().split()) m a = [] [] a
import heapq

n, m = map(int, input().split())
a = []

for i in input().split():
  heapq.heappush(a, -int(i))

for j in range(m):
  highest = heapq.heappop(a)
  heapq.heappush(a, -(-highest // 2))

print(-sum(a))

