def main():

    import heapq

    n,m = list(map(int,input().split()))

    a = list(map(int,input().split()))

    heap = []

    for i in range(n):

        heapq.heappush(heap,-1*a[i])

    for i in range(m):

        a = int(heapq.heappop(heap)/2)

        heapq.heappush(heap,a)

    print((-1*sum(heap)))







if __name__ == "__main__":

    main()
def main():

    import heapq

    n,m = list(map(int,input().split()))

    a = list(map(int,input().split()))

    A = []

    for i in range(n):

        heapq.heappush(A,-1*a[i])

    for i in range(m):

        a = heapq.heappop(A)

        a = (-1*a)//2

        heapq.heappush(A,-1*a)

    print((-1*sum(A)))



if __name__ == "__main__":

    main()

def main():
    import heapq

    n, m = list(map(int, input().split()))
    a = list(map(int, input().split()))
    heap = []
    for i in range(n):
        heapq.heappush(heap, -1 * a[i])
    for i in range(m):
        a = int(heapq.heappop(heap) / 2)
        heapq.heappush(heap, a)
    print((-1 * sum(heap)))


if __name__ == "__main__":
    main()

def main():
    import heapq

    n, m = list(map(int, input().split()))
    a = list(map(int, input().split()))
    A = []
    for i in range(n):
        heapq.heappush(A, -1 * a[i])
    for i in range(m):
        a = heapq.heappop(A)
        a = (-1 * a) // 2
        heapq.heappush(A, -1 * a)
    print((-1 * sum(A)))


if __name__ == "__main__":
    main()

-    heap = [] +    A = [] -        heapq.heappush(heap, -1 * a[i]) +        heapq.heappush(A, -1 * a[i]) -        a = int(heapq.heappop(heap) / 2) -        heapq.heappush(heap, a) -    print((-1 * sum(heap))) +        a = heapq.heappop(A) +        a = (-1 * a) // 2 +        heapq.heappush(A, -1 * a) +    print((-1 * sum(A)))