import sys
import heapq

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


def solve():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    Am = [0] * N
    for i in range(N):
        Am[i] = -A[i]

    heapq.heapify(Am)

    for _ in range(M):
        a = heapq.heappop(Am)
        a = -a
        a = a // 2
        a = -a
        heapq.heappush(Am, a)

    print(-sum(Am))


if __name__ == '__main__':
    solve() import sys sys import heapq heapq input = lambda: sys.stdin.readline().rstrip() input lambda: sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip def solve():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    Am = [0] * N
    for i in range(N):
        Am[i] = -A[i]

    heapq.heapify(Am)

    for _ in range(M):
        a = heapq.heappop(Am)
        a = -a
        a = a // 2
        a = -a
        heapq.heappush(Am, a)

    print(-sum(Am)) solve 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 Am = [0] * N Am [0] * N [0] 0 N for i in range(N):
        Am[i] = -A[i]

     i range(N) range N Am[i] = -A[i] Am[i] Am i -A[i] A[i] A i heapq.heapify(Am) heapq.heapify heapq heapify Am for _ in range(M):
        a = heapq.heappop(Am)
        a = -a
        a = a // 2
        a = -a
        heapq.heappush(Am, a)

     _ range(M) range M a = heapq.heappop(Am) a heapq.heappop(Am) heapq.heappop heapq heappop Am a = -a a -a a a = a // 2 a a // 2 a 2 a = -a a -a a heapq.heappush(Am, a) heapq.heappush heapq heappush Am a print(-sum(Am)) print -sum(Am) sum(Am) sum Am if __name__ == '__main__':
    solve() __name__ == '__main__' __name__ '__main__' solve() solve input = lambda: sys.stdin.readline().rstrip() lambda: sys.stdin.readline().rstrip() input def solve():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    Am = [0] * N
    for i in range(N):
        Am[i] = -A[i]

    heapq.heapify(Am)

    for _ in range(M):
        a = heapq.heappop(Am)
        a = -a
        a = a // 2
        a = -a
        heapq.heappush(Am, a)

    print(-sum(Am)) def solve():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    Am = [0] * N
    for i in range(N):
        Am[i] = -A[i]

    heapq.heapify(Am)

    for _ in range(M):
        a = heapq.heappop(Am)
        a = -a
        a = a // 2
        a = -a
        heapq.heappush(Am, a)

    print(-sum(Am)) solve
import sys
import heapq

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


def solve():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    Am = [0] * N
    for i in range(N):
        Am[i] = -A[i]

    heapq.heapify(Am)

    for _ in range(M):
        a = heapq.heappop(Am)
        a = -a
        a = a // 2
        a = -a
        heapq.heappush(Am, a)

    print(-sum(Am))


if __name__ == '__main__':
    solve()
