from heapq import heappush, heappop



N,M = list(map(int, input().split()))

hq = []

for i in input().split():

    heappush(hq, -int(i))



for i in range(M):

    tmp = -heappop(hq) // 2

    heappush(hq, -tmp)



print((-sum(hq)))    

from heapq import heappush, heappop, heapify



def main():

    N,M = list(map(int, input().split()))

    hq = [-int(i) for i in input().split()]



    heapify(hq)



    for i in range(M):

        tmp = -heappop(hq) // 2

        heappush(hq, -tmp)



    print((-sum(hq)))    



if __name__ == "__main__":

    main()

    
from heapq import heappush, heappop

N, M = list(map(int, input().split()))
hq = []
for i in input().split():
    heappush(hq, -int(i))
for i in range(M):
    tmp = -heappop(hq) // 2
    heappush(hq, -tmp)
print((-sum(hq)))

from heapq import heappush, heappop, heapify


def main():
    N, M = list(map(int, input().split()))
    hq = [-int(i) for i in input().split()]
    heapify(hq)
    for i in range(M):
        tmp = -heappop(hq) // 2
        heappush(hq, -tmp)
    print((-sum(hq)))


if __name__ == "__main__":
    main()

-from heapq import heappush, heappop +from heapq import heappush, heappop, heapify -N, M = list(map(int, input().split())) -hq = [] -for i in input().split(): -    heappush(hq, -int(i)) -for i in range(M): -    tmp = -heappop(hq) // 2 -    heappush(hq, -tmp) -print((-sum(hq))) + +def main(): +    N, M = list(map(int, input().split())) +    hq = [-int(i) for i in input().split()] +    heapify(hq) +    for i in range(M): +        tmp = -heappop(hq) // 2 +        heappush(hq, -tmp) +    print((-sum(hq))) + + +if __name__ == "__main__": +    main()