import sys

stdin = sys.stdin



sys.setrecursionlimit(10 ** 7)



def li(): return list(map(int, stdin.readline().split()))

def li_(): return [int(x) - 1 for x in stdin.readline().split()]

def lf(): return list(map(float, stdin.readline().split()))

def ls(): return stdin.readline().split()

def ns(): return stdin.readline().rstrip()

def lc(): return list(ns())

def ni(): return int(stdin.readline())

def nf(): return float(stdin.readline())



from heapq import heappush, heappop



n, m = li()

a = list(li())



heap = []

for ai in a:

    heappush(heap, -ai)



for _ in range(m):

    cur = -heappop(heap)

    heappush(heap, -(cur // 2))



ans = 0

for hi in heap:

    ans += -hi

print(ans)
import sys

stdin = sys.stdin



sys.setrecursionlimit(10 ** 7)



def li(): return list(map(int, stdin.readline().split()))

def li_(): return [int(x) - 1 for x in stdin.readline().split()]

def lf(): return list(map(float, stdin.readline().split()))

def ls(): return stdin.readline().split()

def ns(): return stdin.readline().rstrip()

def lc(): return list(ns())

def ni(): return int(stdin.readline())

def nf(): return float(stdin.readline())



from heapq import heappop, heappush



n, m = li()

a = list(li())



heap = []



for ai in a:

    heappush(heap, -ai)



for _ in range(m):

    bi = -heappop(heap)

    heappush(heap, -(bi//2))



print((-sum(heap)))

import sys

stdin = sys.stdin
sys.setrecursionlimit(10**7)


def li():
    return list(map(int, stdin.readline().split()))


def li_():
    return [int(x) - 1 for x in stdin.readline().split()]


def lf():
    return list(map(float, stdin.readline().split()))


def ls():
    return stdin.readline().split()


def ns():
    return stdin.readline().rstrip()


def lc():
    return list(ns())


def ni():
    return int(stdin.readline())


def nf():
    return float(stdin.readline())


from heapq import heappush, heappop

n, m = li()
a = list(li())
heap = []
for ai in a:
    heappush(heap, -ai)
for _ in range(m):
    cur = -heappop(heap)
    heappush(heap, -(cur // 2))
ans = 0
for hi in heap:
    ans += -hi
print(ans)

import sys

stdin = sys.stdin
sys.setrecursionlimit(10**7)


def li():
    return list(map(int, stdin.readline().split()))


def li_():
    return [int(x) - 1 for x in stdin.readline().split()]


def lf():
    return list(map(float, stdin.readline().split()))


def ls():
    return stdin.readline().split()


def ns():
    return stdin.readline().rstrip()


def lc():
    return list(ns())


def ni():
    return int(stdin.readline())


def nf():
    return float(stdin.readline())


from heapq import heappop, heappush

n, m = li()
a = list(li())
heap = []
for ai in a:
    heappush(heap, -ai)
for _ in range(m):
    bi = -heappop(heap)
    heappush(heap, -(bi // 2))
print((-sum(heap)))

-from heapq import heappush, heappop +from heapq import heappop, heappush -    cur = -heappop(heap) -    heappush(heap, -(cur // 2)) -ans = 0 -for hi in heap: -    ans += -hi -print(ans) +    bi = -heappop(heap) +    heappush(heap, -(bi // 2)) +print((-sum(heap)))