def resolve():
    N, M = list(map(int, input().split()))
    A = list(map(lambda x: -int(x), input().split()))
    import heapq
    heapq.heapify(A)
    for i in range(M):
        v = heapq.heappop(A)
        heapq.heappush(A, v/2)
    import math
    A = list(map(lambda x: math.floor(-x), A))
    print(sum(A))
    


if '__main__' == __name__:
    resolve() def resolve():
    N, M = list(map(int, input().split()))
    A = list(map(lambda x: -int(x), input().split()))
    import heapq
    heapq.heapify(A)
    for i in range(M):
        v = heapq.heappop(A)
        heapq.heappush(A, v/2)
    import math
    A = list(map(lambda x: math.floor(-x), A))
    print(sum(A))
     resolve N, M = list(map(int, input().split())) N list(map(int, input().split())) list 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 import heapq heapq heapq.heapify(A) heapq.heapify heapq heapify A for i in range(M):
        v = heapq.heappop(A)
        heapq.heappush(A, v/2)
     i range(M) range M v = heapq.heappop(A) v heapq.heappop(A) heapq.heappop heapq heappop A heapq.heappush(A, v/2) heapq.heappush heapq heappush A v/2 v 2 import math math A = list(map(lambda x: math.floor(-x), A)) A list(map(lambda x: math.floor(-x), A)) list map(lambda x: math.floor(-x), A) map lambda x: math.floor(-x) math.floor(-x) math.floor math floor -x x x A print(sum(A)) print sum(A) sum A if '__main__' == __name__:
    resolve() '__main__' == __name__ '__main__' __name__ resolve() resolve def resolve():
    N, M = list(map(int, input().split()))
    A = list(map(lambda x: -int(x), input().split()))
    import heapq
    heapq.heapify(A)
    for i in range(M):
        v = heapq.heappop(A)
        heapq.heappush(A, v/2)
    import math
    A = list(map(lambda x: math.floor(-x), A))
    print(sum(A))
     def resolve():
    N, M = list(map(int, input().split()))
    A = list(map(lambda x: -int(x), input().split()))
    import heapq
    heapq.heapify(A)
    for i in range(M):
        v = heapq.heappop(A)
        heapq.heappush(A, v/2)
    import math
    A = list(map(lambda x: math.floor(-x), A))
    print(sum(A))
     resolve
def resolve():
    N, M = list(map(int, input().split()))
    A = list(map(lambda x: -int(x), input().split()))
    import heapq
    heapq.heapify(A)
    for i in range(M):
        v = heapq.heappop(A)
        heapq.heappush(A, v/2)
    import math
    A = list(map(lambda x: math.floor(-x), A))
    print(sum(A))
    


if '__main__' == __name__:
    resolve()