import heapq
import math

N, M = map(int, input().split())
A = list(map(int, input().split()))
A = list(map(lambda x: x*(-1), A))
heapq.heapify(A)
for _ in range(M):
    tmp = heapq.heappop(A)*(-1)
    heapq.heappush(A, (tmp/2)*(-1))
ans = 0
for _ in range(N):
    ans += math.floor(heapq.heappop(A)*(-1))
print(ans) import heapq heapq import math math N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M A = list(map(int, input().split())) A list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split A = list(map(lambda x: x*(-1), A)) A list(map(lambda x: x*(-1), A)) list map(lambda x: x*(-1), A) map lambda x: x*(-1) x*(-1) x -1 x A heapq.heapify(A) heapq.heapify heapq heapify A for _ in range(M):
    tmp = heapq.heappop(A)*(-1)
    heapq.heappush(A, (tmp/2)*(-1)) _ range(M) range M tmp = heapq.heappop(A)*(-1) tmp heapq.heappop(A)*(-1) heapq.heappop(A) heapq.heappop heapq heappop A -1 heapq.heappush(A, (tmp/2)*(-1)) heapq.heappush heapq heappush A (tmp/2)*(-1) tmp/2 tmp 2 -1 ans = 0 ans 0 for _ in range(N):
    ans += math.floor(heapq.heappop(A)*(-1)) _ range(N) range N ans += math.floor(heapq.heappop(A)*(-1)) ans math.floor(heapq.heappop(A)*(-1)) math.floor math floor heapq.heappop(A)*(-1) heapq.heappop(A) heapq.heappop heapq heappop A -1 print(ans) print ans N, M = map(int, input().split()) map(int, input().split()) N ans += math.floor(heapq.heappop(A)*(-1)) math.floor(heapq.heappop(A)*(-1)) ans tmp = heapq.heappop(A)*(-1) heapq.heappop(A)*(-1) tmp A = list(map(lambda x: x*(-1), A)) list(map(lambda x: x*(-1), A)) A A = list(map(int, input().split())) list(map(int, input().split())) A ans = 0 0 ans M = map(int, input().split()) map(int, input().split()) M
import heapq
import math

N, M = map(int, input().split())
A = list(map(int, input().split()))
A = list(map(lambda x: x*(-1), A))
heapq.heapify(A)
for _ in range(M):
    tmp = heapq.heappop(A)*(-1)
    heapq.heappush(A, (tmp/2)*(-1))
ans = 0
for _ in range(N):
    ans += math.floor(heapq.heappop(A)*(-1))
print(ans)