from heapq import heapify, heappop, heappush

N, M = map(int, input().split())
A = []
for i in input().split():
    A.append(-int(i))
heapify(A)
for _ in range(M):
    a = -heappop(A)
    heappush(A, (a // 2) * -1)
# print('A', A)
ans = -sum(A)
print(ans) from heapq import heapify, heappop, heappush 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():
    A.append(-int(i)) i input().split() ().split () input split A.append(-int(i)) A.append A append -int(i) int(i) int i heapify(A) heapify A for _ in range(M):
    a = -heappop(A)
    heappush(A, (a // 2) * -1)
# print('A', A) _ range(M) range M a = -heappop(A) a -heappop(A) heappop(A) heappop A heappush(A, (a // 2) * -1) heappush A (a // 2) * -1 a // 2 a 2 -1 ans = -sum(A) ans -sum(A) sum(A) sum A print(ans) print ans ans = -sum(A) -sum(A) ans A = [] [] A a = -heappop(A) -heappop(A) a N, M = map(int, input().split()) map(int, input().split()) N M = map(int, input().split()) map(int, input().split()) M
from heapq import heapify, heappop, heappush

N, M = map(int, input().split())
A = []
for i in input().split():
    A.append(-int(i))
heapify(A)
for _ in range(M):
    a = -heappop(A)
    heappush(A, (a // 2) * -1)
# print('A', A)
ans = -sum(A)
print(ans)
