import heapq
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


n, m = LI()
a = LI()
a = list(map(lambda x: -1 * x, a))
heapq.heapify(a)
for _ in range(m):
    price = -1 * heapq.heappop(a)  # 現時点での最大値をO(log N)で取得
    heapq.heappush(a,  -1 * (price // 2))
print(-1 * sum(a)) import heapq heapq import sys sys def input(): return sys.stdin.readline().strip() input def I(): return int(input()) I def LI(): return list(map(int, input().split())) LI I() for i in range(n) for i in range(n) i range(n) range n for i in range(n) I() I def IR(n): return [I() for i in range(n)] IR n n LI() for i in range(n) for i in range(n) i range(n) range n for i in range(n) LI() LI def LIR(n): return [LI() for i in range(n)] LIR n n S() for i in range(n) for i in range(n) i range(n) range n for i in range(n) S() S def SR(n): return [S() for i in range(n)] SR n n def S(): return input() S def LS(): return input().split() LS n, m = LI() n LI() LI m a = LI() a LI() LI a = list(map(lambda x: -1 * x, a)) a list(map(lambda x: -1 * x, a)) list map(lambda x: -1 * x, a) map lambda x: -1 * x -1 * x -1 x x a heapq.heapify(a) heapq.heapify heapq heapify a for _ in range(m):
    price = -1 * heapq.heappop(a)  # 現時点での最大値をO(log N)で取得
    heapq.heappush(a,  -1 * (price // 2)) _ range(m) range m price = -1 * heapq.heappop(a) price -1 * heapq.heappop(a) -1 heapq.heappop(a) heapq.heappop heapq heappop a heapq.heappush(a,  -1 * (price // 2)) heapq.heappush heapq heappush a -1 * (price // 2) -1 price // 2 price 2 print(-1 * sum(a)) print -1 * sum(a) -1 sum(a) sum a def IR(n): return [I() for i in range(n)] def IR(n): return [I() for i in range(n)] IR a = LI() LI() a m = LI() LI() m n, m = LI() LI() n price = -1 * heapq.heappop(a) -1 * heapq.heappop(a) price a = list(map(lambda x: -1 * x, a)) list(map(lambda x: -1 * x, a)) a def S(): return input() def S(): return input() S def input(): return sys.stdin.readline().strip() def input(): return sys.stdin.readline().strip() input def LS(): return input().split() def LS(): return input().split() LS def SR(n): return [S() for i in range(n)] def SR(n): return [S() for i in range(n)] SR def LIR(n): return [LI() for i in range(n)] def LIR(n): return [LI() for i in range(n)] LIR def LI(): return list(map(int, input().split())) def LI(): return list(map(int, input().split())) LI def I(): return int(input()) def I(): return int(input()) I
import heapq
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


n, m = LI()
a = LI()
a = list(map(lambda x: -1 * x, a))
heapq.heapify(a)
for _ in range(m):
    price = -1 * heapq.heappop(a)  # 現時点での最大値をO(log N)で取得
    heapq.heappush(a,  -1 * (price // 2))
print(-1 * sum(a))
