def resolve():
    import heapq
    import sys
    input = sys.stdin.readline
    _, M = [int(i) for i in input().split()]
    A = [-int(i) for i in input().split()]
    heapq.heapify(A)
    for _ in range(M):
        heapq.heappush(A, -(-heapq.heappop(A) // 2))
    print(-sum(A))

resolve() def resolve():
    import heapq
    import sys
    input = sys.stdin.readline
    _, M = [int(i) for i in input().split()]
    A = [-int(i) for i in input().split()]
    heapq.heapify(A)
    for _ in range(M):
        heapq.heappush(A, -(-heapq.heappop(A) // 2))
    print(-sum(A)) resolve import heapq heapq import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i _, M = [int(i) for i in input().split()] _ [int(i) for i in input().split()] M -int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() -int(i) int(i) int i A = [-int(i) for i in input().split()] A [-int(i) for i in input().split()] heapq.heapify(A) heapq.heapify heapq heapify A for _ in range(M):
        heapq.heappush(A, -(-heapq.heappop(A) // 2))
     _ range(M) range M heapq.heappush(A, -(-heapq.heappop(A) // 2)) heapq.heappush heapq heappush A -(-heapq.heappop(A) // 2) -heapq.heappop(A) // 2 -heapq.heappop(A) heapq.heappop(A) heapq.heappop heapq heappop A 2 print(-sum(A)) print -sum(A) sum(A) sum A resolve() resolve def resolve():
    import heapq
    import sys
    input = sys.stdin.readline
    _, M = [int(i) for i in input().split()]
    A = [-int(i) for i in input().split()]
    heapq.heapify(A)
    for _ in range(M):
        heapq.heappush(A, -(-heapq.heappop(A) // 2))
    print(-sum(A)) def resolve():
    import heapq
    import sys
    input = sys.stdin.readline
    _, M = [int(i) for i in input().split()]
    A = [-int(i) for i in input().split()]
    heapq.heapify(A)
    for _ in range(M):
        heapq.heappush(A, -(-heapq.heappop(A) // 2))
    print(-sum(A)) resolve
def resolve():
    import heapq
    import sys
    input = sys.stdin.readline
    _, M = [int(i) for i in input().split()]
    A = [-int(i) for i in input().split()]
    heapq.heapify(A)
    for _ in range(M):
        heapq.heappush(A, -(-heapq.heappop(A) // 2))
    print(-sum(A))

resolve()
