from heapq import heapify, heappop, heappush

def main():

    # Aをpriority qにつっこむ
    # 大きい順にM回discountする
    # 最後に総計を計算する

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

    while M > 0:
        a = -heappop(A)
        a //= 2
        heappush(A, -a)
        M -= 1
    
    ans = 0
    for a in A:
        ans -= a

    print(ans)

if __name__ == "__main__":
    main() from heapq import heapify, heappop, heappush def main():

    # Aをpriority qにつっこむ
    # 大きい順にM回discountする
    # 最後に総計を計算する

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

    while M > 0:
        a = -heappop(A)
        a //= 2
        heappush(A, -a)
        M -= 1
    
    ans = 0
    for a in A:
        ans -= a

    print(ans) main 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 -a for a in A for a in A a A for a in A -a a A = [-a for a in A] A [-a for a in A] heapify(A) heapify A while M > 0:
        a = -heappop(A)
        a //= 2
        heappush(A, -a)
        M -= 1
    
     M > 0 M 0 a = -heappop(A) a -heappop(A) heappop(A) heappop A a //= 2 a 2 heappush(A, -a) heappush A -a a M -= 1 M 1 ans = 0 ans 0 for a in A:
        ans -= a

     a A ans -= a ans a print(ans) print ans if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():

    # Aをpriority qにつっこむ
    # 大きい順にM回discountする
    # 最後に総計を計算する

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

    while M > 0:
        a = -heappop(A)
        a //= 2
        heappush(A, -a)
        M -= 1
    
    ans = 0
    for a in A:
        ans -= a

    print(ans) def main():

    # Aをpriority qにつっこむ
    # 大きい順にM回discountする
    # 最後に総計を計算する

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

    while M > 0:
        a = -heappop(A)
        a //= 2
        heappush(A, -a)
        M -= 1
    
    ans = 0
    for a in A:
        ans -= a

    print(ans) main
from heapq import heapify, heappop, heappush

def main():

    # Aをpriority qにつっこむ
    # 大きい順にM回discountする
    # 最後に総計を計算する

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

    while M > 0:
        a = -heappop(A)
        a //= 2
        heappush(A, -a)
        M -= 1
    
    ans = 0
    for a in A:
        ans -= a

    print(ans)

if __name__ == "__main__":
    main()
