import sys

sys.setrecursionlimit(2147483647)

INF=float("inf")

MOD=10**9+7

import heapq

input=sys.stdin.readline

def resolve():

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

    A=list([-(int(x)) for x in input().split()])

    heapq.heapify(A)

    for _ in range(m):

        a=heapq.heappop(A)

        a=-a

        a=a>>1

        heapq.heappush(A,-a)

    print((-sum(A)))



resolve()
import sys

sys.setrecursionlimit(2147483647)

INF=float("inf")

MOD=10**9+7

input=lambda :sys.stdin.readline().rstrip()

def resolve():

    from heapq import heapify,heappop,heappush

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

    A=[-a for a in map(int,input().split())]

    heapify(A)

    for _ in range(m):

        x=-heappop(A)

        heappush(A,-(x//2))

    print((-sum(A)))

resolve()
import sys

sys.setrecursionlimit(2147483647)
INF = float("inf")
MOD = 10**9 + 7
import heapq

input = sys.stdin.readline


def resolve():
    n, m = list(map(int, input().split()))
    A = list([-(int(x)) for x in input().split()])
    heapq.heapify(A)
    for _ in range(m):
        a = heapq.heappop(A)
        a = -a
        a = a >> 1
        heapq.heappush(A, -a)
    print((-sum(A)))


resolve()

import sys

sys.setrecursionlimit(2147483647)
INF = float("inf")
MOD = 10**9 + 7
input = lambda: sys.stdin.readline().rstrip()


def resolve():
    from heapq import heapify, heappop, heappush

    n, m = list(map(int, input().split()))
    A = [-a for a in map(int, input().split())]
    heapify(A)
    for _ in range(m):
        x = -heappop(A)
        heappush(A, -(x // 2))
    print((-sum(A)))


resolve()

-import heapq - -input = sys.stdin.readline +input = lambda: sys.stdin.readline().rstrip() +    from heapq import heapify, heappop, heappush + -    A = list([-(int(x)) for x in input().split()]) -    heapq.heapify(A) +    A = [-a for a in map(int, input().split())] +    heapify(A) -        a = heapq.heappop(A) -        a = -a -        a = a >> 1 -        heapq.heappush(A, -a) +        x = -heappop(A) +        heappush(A, -(x // 2))