import heapq
def solve():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    a = list(map(lambda x: x*(-1), a))

    heapq.heapify(a)
    cnt = 0
    while cnt < m:
        x = heapq.heappop(a)
        heapq.heappush(a, -(-x//2))
        cnt += 1
        if x == 0: break

    return sum(a)*(-1)

print(solve()) import heapq heapq def solve():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    a = list(map(lambda x: x*(-1), a))

    heapq.heapify(a)
    cnt = 0
    while cnt < m:
        x = heapq.heappop(a)
        heapq.heappush(a, -(-x//2))
        cnt += 1
        if x == 0: break

    return sum(a)*(-1) solve 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 cnt = 0 cnt 0 while cnt < m:
        x = heapq.heappop(a)
        heapq.heappush(a, -(-x//2))
        cnt += 1
        if x == 0: break

     cnt < m cnt m x = heapq.heappop(a) x heapq.heappop(a) heapq.heappop heapq heappop a heapq.heappush(a, -(-x//2)) heapq.heappush heapq heappush a -(-x//2) -x//2 -x x 2 cnt += 1 cnt 1 if x == 0: break

     x == 0 x 0 return sum(a)*(-1) sum(a)*(-1) sum(a) sum a -1 print(solve()) print solve() solve def solve():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    a = list(map(lambda x: x*(-1), a))

    heapq.heapify(a)
    cnt = 0
    while cnt < m:
        x = heapq.heappop(a)
        heapq.heappush(a, -(-x//2))
        cnt += 1
        if x == 0: break

    return sum(a)*(-1) def solve():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    a = list(map(lambda x: x*(-1), a))

    heapq.heapify(a)
    cnt = 0
    while cnt < m:
        x = heapq.heappop(a)
        heapq.heappush(a, -(-x//2))
        cnt += 1
        if x == 0: break

    return sum(a)*(-1) solve
import heapq
def solve():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    a = list(map(lambda x: x*(-1), a))

    heapq.heapify(a)
    cnt = 0
    while cnt < m:
        x = heapq.heappop(a)
        heapq.heappush(a, -(-x//2))
        cnt += 1
        if x == 0: break

    return sum(a)*(-1)

print(solve())