from heapq import heappush, heappop





def solve(string):

    n, m, *a = list(map(int, string.split()))

    h = []

    for _a in a:

        heappush(h, -_a)

    for _ in range(m):

        heappush(h, -(-heappop(h) // 2))

    return str(-sum(h))





if __name__ == '__main__':

    print((solve('\n'.join([eval(input()), eval(input())]))))

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

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

l = len(arr)



while m != 0 :

    arr.sort(reverse=True)

    j = arr[0] // 2

    for i in range(l):

            if arr[i] > j:

                if m != 0:

                    m -= 1

                else:

                    break

                arr[i] //= 2

            else:

                break

    if arr[0] == 0:

        break

            



print((sum(arr)))        

from heapq import heappush, heappop


def solve(string):
    n, m, *a = list(map(int, string.split()))
    h = []
    for _a in a:
        heappush(h, -_a)
    for _ in range(m):
        heappush(h, -(-heappop(h) // 2))
    return str(-sum(h))


if __name__ == "__main__":
    print((solve("\n".join([eval(input()), eval(input())]))))

n, m = list(map(int, input().split()))
arr = list(map(int, input().split()))
l = len(arr)
while m != 0:
    arr.sort(reverse=True)
    j = arr[0] // 2
    for i in range(l):
        if arr[i] > j:
            if m != 0:
                m -= 1
            else:
                break
            arr[i] //= 2
        else:
            break
    if arr[0] == 0:
        break
print((sum(arr)))

-from heapq import heappush, heappop - - -def solve(string): -    n, m, *a = list(map(int, string.split())) -    h = [] -    for _a in a: -        heappush(h, -_a) -    for _ in range(m): -        heappush(h, -(-heappop(h) // 2)) -    return str(-sum(h)) - - -if __name__ == "__main__": -    print((solve("\n".join([eval(input()), eval(input())])))) +n, m = list(map(int, input().split())) +arr = list(map(int, input().split())) +l = len(arr) +while m != 0: +    arr.sort(reverse=True) +    j = arr[0] // 2 +    for i in range(l): +        if arr[i] > j: +            if m != 0: +                m -= 1 +            else: +                break +            arr[i] //= 2 +        else: +            break +    if arr[0] == 0: +        break +print((sum(arr)))