import math        # factorical（階乗) # hypot(距離)
import heapq
# from fractions import gcd # Python3.5以前 # lcm（最小公倍数） = (a*b)//gcd(a,b)
# from fractions import Fraction
# from math import gcd # Python3.6以降
# --------------------------------------------------------------

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

price = [-i for i in price]

heapq.heapify(price)

for i in range(m):
    sm = heapq.heappop(price)
    sm = -(-sm//2)
    heapq.heappush(price,sm)

price = [-i for i in price]

print(sum(price)) import math math import heapq heapq n,m = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split m price = list(map(int,input().split())) price list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split -i for i in price for i in price i price for i in price -i i price = [-i for i in price] price [-i for i in price] heapq.heapify(price) heapq.heapify heapq heapify price for i in range(m):
    sm = heapq.heappop(price)
    sm = -(-sm//2)
    heapq.heappush(price,sm) i range(m) range m sm = heapq.heappop(price) sm heapq.heappop(price) heapq.heappop heapq heappop price sm = -(-sm//2) sm -(-sm//2) -sm//2 -sm sm 2 heapq.heappush(price,sm) heapq.heappush heapq heappush price sm -i for i in price for i in price i price for i in price -i i price = [-i for i in price] price [-i for i in price] print(sum(price)) print sum(price) sum price price = [-i for i in price] [-i for i in price] price sm = heapq.heappop(price) heapq.heappop(price) sm price = [-i for i in price] [-i for i in price] price price = list(map(int,input().split())) list(map(int,input().split())) price sm = -(-sm//2) -(-sm//2) sm m = map(int,input().split()) map(int,input().split()) m n,m = map(int,input().split()) map(int,input().split()) n
import math        # factorical（階乗) # hypot(距離)
import heapq
# from fractions import gcd # Python3.5以前 # lcm（最小公倍数） = (a*b)//gcd(a,b)
# from fractions import Fraction
# from math import gcd # Python3.6以降
# --------------------------------------------------------------

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

price = [-i for i in price]

heapq.heapify(price)

for i in range(m):
    sm = heapq.heappop(price)
    sm = -(-sm//2)
    heapq.heappush(price,sm)

price = [-i for i in price]

print(sum(price))