from collections import Counter,defaultdict,deque

import sys,heapq,bisect,math,itertools,string,queue

sys.setrecursionlimit(10**8)

mod = 10**9+7

def inp(): return int(sys.stdin.readline())

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

def inpl_str(): return list(sys.stdin.readline().split())

def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))



n,m = inpl()

a = inpl()

hq = []

heapq.heapify(hq)

ans = 0

for i in range(n):

    tt = a[i]

    heapq.heappush(hq,-tt)

for i in range(m):

    tmp = heapq.heappop(hq)

    tmp /= 2

    heapq.heappush(hq,tmp)

    # print(hq)

for i in range(n):

    tttt = heapq.heappop(hq)

    ans -= math.ceil(tttt)

print(ans)
from collections import Counter,defaultdict,deque

from heapq import heappop,heappush,heapify

from bisect import bisect_left,bisect_right 

import sys,math,itertools,fractions,pprint

sys.setrecursionlimit(10**8)

mod = 10**9+7

INF = float('inf')

def inp(): return int(sys.stdin.readline())

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



n,m = inpl()

a = inpl()

a = [-x for x in a]

heapify(a)

for _ in range(m):

    now = heappop(a)

    now /= 2

    heappush(a,now)

    # print(now)

res = 0

for x in a:

    res += int(-x)

print(res)

from collections import Counter, defaultdict, deque
import sys, heapq, bisect, math, itertools, string, queue

sys.setrecursionlimit(10**8)
mod = 10**9 + 7


def inp():
    return int(sys.stdin.readline())


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


def inpl_str():
    return list(sys.stdin.readline().split())


def inpln(n):
    return list(int(sys.stdin.readline()) for i in range(n))


n, m = inpl()
a = inpl()
hq = []
heapq.heapify(hq)
ans = 0
for i in range(n):
    tt = a[i]
    heapq.heappush(hq, -tt)
for i in range(m):
    tmp = heapq.heappop(hq)
    tmp /= 2
    heapq.heappush(hq, tmp)
    # print(hq)
for i in range(n):
    tttt = heapq.heappop(hq)
    ans -= math.ceil(tttt)
print(ans)

from collections import Counter, defaultdict, deque
from heapq import heappop, heappush, heapify
from bisect import bisect_left, bisect_right
import sys, math, itertools, fractions, pprint

sys.setrecursionlimit(10**8)
mod = 10**9 + 7
INF = float("inf")


def inp():
    return int(sys.stdin.readline())


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


n, m = inpl()
a = inpl()
a = [-x for x in a]
heapify(a)
for _ in range(m):
    now = heappop(a)
    now /= 2
    heappush(a, now)
    # print(now)
res = 0
for x in a:
    res += int(-x)
print(res)

-import sys, heapq, bisect, math, itertools, string, queue +from heapq import heappop, heappush, heapify +from bisect import bisect_left, bisect_right +import sys, math, itertools, fractions, pprint +INF = float("inf") -def inpl_str(): -    return list(sys.stdin.readline().split()) - - -def inpln(n): -    return list(int(sys.stdin.readline()) for i in range(n)) - - -hq = [] -heapq.heapify(hq) -ans = 0 -for i in range(n): -    tt = a[i] -    heapq.heappush(hq, -tt) -for i in range(m): -    tmp = heapq.heappop(hq) -    tmp /= 2 -    heapq.heappush(hq, tmp) -    # print(hq) -for i in range(n): -    tttt = heapq.heappop(hq) -    ans -= math.ceil(tttt) -print(ans) +a = [-x for x in a] +heapify(a) +for _ in range(m): +    now = heappop(a) +    now /= 2 +    heappush(a, now) +    # print(now) +res = 0 +for x in a: +    res += int(-x) +print(res)