def slove():

    import sys

    import heapq

    input = sys.stdin.readline

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

    a = list(map(int, input().rstrip('\n').split()))

    for i in range(len(a)):

        a[i] = a[i] * - 1

    heapq.heapify(a)

    for i in range(m):

        p = heapq.heappop(a)

        p /= 2

        heapq.heappush(a, p)

    t = 0

    for i in range(len(a)):

        t += int(a[i])

    print((-t))





if __name__ == '__main__':

    slove()

def slove():

    import sys

    import heapq

    input = sys.stdin.readline

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

    a = [- i for i in list(map(int, input().rstrip('\n').split()))]

    heapq.heapify(a)

    for i in range(m):

        heapq.heappush(a, -(-heapq.heappop(a) // 2))

    print((-sum(a)))





if __name__ == '__main__':

    slove()

def slove():
    import sys
    import heapq

    input = sys.stdin.readline
    n, m = list(map(int, input().rstrip("\n").split()))
    a = list(map(int, input().rstrip("\n").split()))
    for i in range(len(a)):
        a[i] = a[i] * -1
    heapq.heapify(a)
    for i in range(m):
        p = heapq.heappop(a)
        p /= 2
        heapq.heappush(a, p)
    t = 0
    for i in range(len(a)):
        t += int(a[i])
    print((-t))


if __name__ == "__main__":
    slove()

def slove():
    import sys
    import heapq

    input = sys.stdin.readline
    n, m = list(map(int, input().rstrip("\n").split()))
    a = [-i for i in list(map(int, input().rstrip("\n").split()))]
    heapq.heapify(a)
    for i in range(m):
        heapq.heappush(a, -(-heapq.heappop(a) // 2))
    print((-sum(a)))


if __name__ == "__main__":
    slove()

-    a = list(map(int, input().rstrip("\n").split())) -    for i in range(len(a)): -        a[i] = a[i] * -1 +    a = [-i for i in list(map(int, input().rstrip("\n").split()))] -        p = heapq.heappop(a) -        p /= 2 -        heapq.heappush(a, p) -    t = 0 -    for i in range(len(a)): -        t += int(a[i]) -    print((-t)) +        heapq.heappush(a, -(-heapq.heappop(a) // 2)) +    print((-sum(a)))