def abc141d():
    import heapq
    n, m = map(int, input().split())
    a = list(map(lambda x: -int(x), input().split()))
    heapq.heapify(a)
    for _ in range(m):
        v = -heapq.heappop(a)
        v = v//2
        heapq.heappush(a, -v)
    print(abs(sum(a)))

abc141d() def abc141d():
    import heapq
    n, m = map(int, input().split())
    a = list(map(lambda x: -int(x), input().split()))
    heapq.heapify(a)
    for _ in range(m):
        v = -heapq.heappop(a)
        v = v//2
        heapq.heappush(a, -v)
    print(abs(sum(a))) abc141d import heapq heapq n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m a = list(map(lambda x: -int(x), input().split())) a list(map(lambda x: -int(x), input().split())) list map(lambda x: -int(x), input().split()) map lambda x: -int(x) -int(x) int(x) int x x input().split() ().split () input split heapq.heapify(a) heapq.heapify heapq heapify a for _ in range(m):
        v = -heapq.heappop(a)
        v = v//2
        heapq.heappush(a, -v)
     _ range(m) range m v = -heapq.heappop(a) v -heapq.heappop(a) heapq.heappop(a) heapq.heappop heapq heappop a v = v//2 v v//2 v 2 heapq.heappush(a, -v) heapq.heappush heapq heappush a -v v print(abs(sum(a))) print abs(sum(a)) abs sum(a) sum a abc141d() abc141d def abc141d():
    import heapq
    n, m = map(int, input().split())
    a = list(map(lambda x: -int(x), input().split()))
    heapq.heapify(a)
    for _ in range(m):
        v = -heapq.heappop(a)
        v = v//2
        heapq.heappush(a, -v)
    print(abs(sum(a))) def abc141d():
    import heapq
    n, m = map(int, input().split())
    a = list(map(lambda x: -int(x), input().split()))
    heapq.heapify(a)
    for _ in range(m):
        v = -heapq.heappop(a)
        v = v//2
        heapq.heappush(a, -v)
    print(abs(sum(a))) abc141d
def abc141d():
    import heapq
    n, m = map(int, input().split())
    a = list(map(lambda x: -int(x), input().split()))
    heapq.heapify(a)
    for _ in range(m):
        v = -heapq.heappop(a)
        v = v//2
        heapq.heappush(a, -v)
    print(abs(sum(a)))

abc141d()