#!/usr/bin/env python3



from heapq import heapify, heappop, heappush



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

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

a = [-1*item for item in a]

heapify(a)



for i in range(m):

    max = -1* heappop(a)

    heappush(a, int(-1*max/2))  # 要素の挿入



a = [-1*item for item in a]

ans = sum(list(a))



print(ans)

#!/usr/bin/env python3



from heapq import heapify, heappop, heappush



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

a = list([int(x)*-1 for x in input().split()])



heapify(a)



for i in range(m):

    min = heappop(a)

    heappush(a, (-1)*(-1*min//2)) # 要素の挿入



ans = -sum(a)



print(ans)

#!/usr/bin/env python3
from heapq import heapify, heappop, heappush

n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
a = [-1 * item for item in a]
heapify(a)
for i in range(m):
    max = -1 * heappop(a)
    heappush(a, int(-1 * max / 2))  # 要素の挿入
a = [-1 * item for item in a]
ans = sum(list(a))
print(ans)

#!/usr/bin/env python3
from heapq import heapify, heappop, heappush

n, m = list(map(int, input().split()))
a = list([int(x) * -1 for x in input().split()])
heapify(a)
for i in range(m):
    min = heappop(a)
    heappush(a, (-1) * (-1 * min // 2))  # 要素の挿入
ans = -sum(a)
print(ans)

-a = list(map(int, input().split())) -a = [-1 * item for item in a] +a = list([int(x) * -1 for x in input().split()]) -    max = -1 * heappop(a) -    heappush(a, int(-1 * max / 2))  # 要素の挿入 -a = [-1 * item for item in a] -ans = sum(list(a)) +    min = heappop(a) +    heappush(a, (-1) * (-1 * min // 2))  # 要素の挿入 +ans = -sum(a)