from heapq import heappush,heappop,heapify

from math import ceil

def main():

    N, M = (int(i) for i in input().split())

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

    heapify(A)

    for divcnt in range(M):

        tmp = ceil(heappop(A)/2)

        heappush(A,tmp)

    print((-sum(A)))

if __name__ == "__main__":

    main()

def main():

    from heapq import heappush,heappop,heapify

    N, M = (int(i) for i in input().split())

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

    heapify(A)

    for divcnt in range(M):

        tmp = -heappop(A)

        tmp //= 2

        heappush(A,-tmp)

    print((-sum(A)))

if __name__ == "__main__":

    main()

from heapq import heappush, heappop, heapify
from math import ceil


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


if __name__ == "__main__":
    main()

def main():
    from heapq import heappush, heappop, heapify

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


if __name__ == "__main__":
    main()

-from heapq import heappush, heappop, heapify -from math import ceil +def main(): +    from heapq import heappush, heappop, heapify - -def main(): -        tmp = ceil(heappop(A) / 2) -        heappush(A, tmp) +        tmp = -heappop(A) +        tmp //= 2 +        heappush(A, -tmp)