import bisect

N,M = list(map(int, input().split()))
As = list(map(int, input().split()))

As.sort()

#print(As)

for _ in range(M):
    discount = As.pop(-1)

    if(discount == 0):
        break

    discount //= 2

    i = bisect.bisect_left(As, discount)
    As.insert(i, discount)
#    print(As)

print(sum(As)) import bisect bisect N,M = list(map(int, input().split())) N list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split M As = list(map(int, input().split())) As list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split As.sort() As.sort As sort for _ in range(M):
    discount = As.pop(-1)

    if(discount == 0):
        break

    discount //= 2

    i = bisect.bisect_left(As, discount)
    As.insert(i, discount)
#    print(As) _ range(M) range M discount = As.pop(-1) discount As.pop(-1) As.pop As pop -1 if(discount == 0):
        break

     discount == 0 discount 0 break discount //= 2 discount 2 i = bisect.bisect_left(As, discount) i bisect.bisect_left(As, discount) bisect.bisect_left bisect bisect_left As discount As.insert(i, discount) As.insert As insert i discount print(sum(As)) print sum(As) sum As i = bisect.bisect_left(As, discount) bisect.bisect_left(As, discount) i As = list(map(int, input().split())) list(map(int, input().split())) As N,M = list(map(int, input().split())) list(map(int, input().split())) N discount = As.pop(-1) As.pop(-1) discount discount //= 2 2 discount M = list(map(int, input().split())) list(map(int, input().split())) M
import bisect

N,M = list(map(int, input().split()))
As = list(map(int, input().split()))

As.sort()

#print(As)

for _ in range(M):
    discount = As.pop(-1)

    if(discount == 0):
        break

    discount //= 2

    i = bisect.bisect_left(As, discount)
    As.insert(i, discount)
#    print(As)

print(sum(As))