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()))

    while m > 0:

        a.sort(reverse=True)

        if a[0] == 0:

            break

        b = a[0] // 2

        for i, _a in enumerate(a):

            if m == 0 or _a <= b:

                break

            a[i] //= 2

            m -= 1

    return str(sum(a))





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()))
    while m > 0:
        a.sort(reverse=True)
        if a[0] == 0:
            break
        b = a[0] // 2
        for i, _a in enumerate(a):
            if m == 0 or _a <= b:
                break
            a[i] //= 2
            m -= 1
    return str(sum(a))


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: +from heapq import heappush, heappop + + +def solve(string): +    n, m, *a = list(map(int, string.split())) +    while m > 0: +        a.sort(reverse=True) +        if a[0] == 0: +            break +        b = a[0] // 2 +        for i, _a in enumerate(a): +            if m == 0 or _a <= b: -            arr[i] //= 2 -        else: -            break -    if arr[0] == 0: -        break -print((sum(arr))) +            a[i] //= 2 +            m -= 1 +    return str(sum(a)) + + +if __name__ == "__main__": +    print((solve("\n".join([eval(input()), eval(input())]))))