from heapq import heappush, heappop

def resolve():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    heap = []
    for i in a:
        heappush(heap, [-i, i, 0])

    for i in range(m):
        num, x, cnt = heappop(heap)
        heappush(heap, [num / 2, x, cnt + 1])

    ans = 0
    for i in range(n):
        num, x, cnt = heappop(heap)
        ans += int(num)
    print(-ans)


if __name__ == "__main__":
    resolve() from heapq import heappush, heappop def resolve():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    heap = []
    for i in a:
        heappush(heap, [-i, i, 0])

    for i in range(m):
        num, x, cnt = heappop(heap)
        heappush(heap, [num / 2, x, cnt + 1])

    ans = 0
    for i in range(n):
        num, x, cnt = heappop(heap)
        ans += int(num)
    print(-ans) resolve n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m a = list(map(int, input().split())) a list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split heap = [] heap [] for i in a:
        heappush(heap, [-i, i, 0])

     i a heappush(heap, [-i, i, 0]) heappush heap [-i, i, 0] -i i i 0 for i in range(m):
        num, x, cnt = heappop(heap)
        heappush(heap, [num / 2, x, cnt + 1])

     i range(m) range m num, x, cnt = heappop(heap) num heappop(heap) heappop heap x cnt heappush(heap, [num / 2, x, cnt + 1]) heappush heap [num / 2, x, cnt + 1] num / 2 num 2 x cnt + 1 cnt 1 ans = 0 ans 0 for i in range(n):
        num, x, cnt = heappop(heap)
        ans += int(num)
     i range(n) range n num, x, cnt = heappop(heap) num heappop(heap) heappop heap x cnt ans += int(num) ans int(num) int num print(-ans) print -ans ans if __name__ == "__main__":
    resolve() __name__ == "__main__" __name__ "__main__" resolve() resolve def resolve():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    heap = []
    for i in a:
        heappush(heap, [-i, i, 0])

    for i in range(m):
        num, x, cnt = heappop(heap)
        heappush(heap, [num / 2, x, cnt + 1])

    ans = 0
    for i in range(n):
        num, x, cnt = heappop(heap)
        ans += int(num)
    print(-ans) def resolve():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    heap = []
    for i in a:
        heappush(heap, [-i, i, 0])

    for i in range(m):
        num, x, cnt = heappop(heap)
        heappush(heap, [num / 2, x, cnt + 1])

    ans = 0
    for i in range(n):
        num, x, cnt = heappop(heap)
        ans += int(num)
    print(-ans) resolve
from heapq import heappush, heappop

def resolve():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    heap = []
    for i in a:
        heappush(heap, [-i, i, 0])

    for i in range(m):
        num, x, cnt = heappop(heap)
        heappush(heap, [num / 2, x, cnt + 1])

    ans = 0
    for i in range(n):
        num, x, cnt = heappop(heap)
        ans += int(num)
    print(-ans)


if __name__ == "__main__":
    resolve()
