def calc(N, M, A):

    if (N == 1):

        return A[0] // (2 ** M)

    A.sort(key=lambda a: -a)

    B = [A]

    for _ in range(M):

        i = 0

        m = B[0][0] if B[0] else -1

        for j in range(1, len(B)):

            if (B[j] and B[j][0] > m):

                i = j

                m = B[j][0]

        p = B[i].pop(0) // 2

        if (len(B) == i + 1):

            B += [[]]

        B[i + 1] += [p]

        if (not (B[0])):

            B.pop(0)

    return sum([sum(b) for b in B])





(N, M) = tuple([int(s) for s in input().split(' ')])

A = [int(s) for s in input().split()]

print((calc(N, M, A)))
import heapq



def calc(N, M, A):

    if (N == 1):

        return A[0] // (2 ** M)

    H = []

    for a in A:

        heapq.heappush(H, -a)

    for _ in range(M):

        a = (-heapq.heappop(H)) // 2

        heapq.heappush(H, -a)

    return -sum(H)





(N, M) = tuple([int(s) for s in input().split(' ')])

A = [int(s) for s in input().split()]

print((calc(N, M, A)))
def calc(N, M, A):
    if N == 1:
        return A[0] // (2**M)
    A.sort(key=lambda a: -a)
    B = [A]
    for _ in range(M):
        i = 0
        m = B[0][0] if B[0] else -1
        for j in range(1, len(B)):
            if B[j] and B[j][0] > m:
                i = j
                m = B[j][0]
        p = B[i].pop(0) // 2
        if len(B) == i + 1:
            B += [[]]
        B[i + 1] += [p]
        if not (B[0]):
            B.pop(0)
    return sum([sum(b) for b in B])


(N, M) = tuple([int(s) for s in input().split(" ")])
A = [int(s) for s in input().split()]
print((calc(N, M, A)))

import heapq


def calc(N, M, A):
    if N == 1:
        return A[0] // (2**M)
    H = []
    for a in A:
        heapq.heappush(H, -a)
    for _ in range(M):
        a = (-heapq.heappop(H)) // 2
        heapq.heappush(H, -a)
    return -sum(H)


(N, M) = tuple([int(s) for s in input().split(" ")])
A = [int(s) for s in input().split()]
print((calc(N, M, A)))

+import heapq + + -    A.sort(key=lambda a: -a) -    B = [A] +    H = [] +    for a in A: +        heapq.heappush(H, -a) -        i = 0 -        m = B[0][0] if B[0] else -1 -        for j in range(1, len(B)): -            if B[j] and B[j][0] > m: -                i = j -                m = B[j][0] -        p = B[i].pop(0) // 2 -        if len(B) == i + 1: -            B += [[]] -        B[i + 1] += [p] -        if not (B[0]): -            B.pop(0) -    return sum([sum(b) for b in B]) +        a = (-heapq.heappop(H)) // 2 +        heapq.heappush(H, -a) +    return -sum(H)