import heapq
def main():
    n, m = list(map(int, input().split()))
    t = list(map(int, input().split()))
    t = list(map(lambda x: x*(-1), t))
    heapq.heapify(t)
    while m > 0:
        v = heapq.heappop(t) * -1
        heapq.heappush(t, (v // 2)* -1)
        m -= 1

    print(sum(t)*-1)


if __name__ == '__main__':
    main() import heapq heapq def main():
    n, m = list(map(int, input().split()))
    t = list(map(int, input().split()))
    t = list(map(lambda x: x*(-1), t))
    heapq.heapify(t)
    while m > 0:
        v = heapq.heappop(t) * -1
        heapq.heappush(t, (v // 2)* -1)
        m -= 1

    print(sum(t)*-1) main n, m = list(map(int, input().split())) n list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split m t = list(map(int, input().split())) t list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split t = list(map(lambda x: x*(-1), t)) t list(map(lambda x: x*(-1), t)) list map(lambda x: x*(-1), t) map lambda x: x*(-1) x*(-1) x -1 x t heapq.heapify(t) heapq.heapify heapq heapify t while m > 0:
        v = heapq.heappop(t) * -1
        heapq.heappush(t, (v // 2)* -1)
        m -= 1

     m > 0 m 0 v = heapq.heappop(t) * -1 v heapq.heappop(t) * -1 heapq.heappop(t) heapq.heappop heapq heappop t -1 heapq.heappush(t, (v // 2)* -1) heapq.heappush heapq heappush t (v // 2)* -1 v // 2 v 2 -1 m -= 1 m 1 print(sum(t)*-1) print sum(t)*-1 sum(t) sum t -1 if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    n, m = list(map(int, input().split()))
    t = list(map(int, input().split()))
    t = list(map(lambda x: x*(-1), t))
    heapq.heapify(t)
    while m > 0:
        v = heapq.heappop(t) * -1
        heapq.heappush(t, (v // 2)* -1)
        m -= 1

    print(sum(t)*-1) def main():
    n, m = list(map(int, input().split()))
    t = list(map(int, input().split()))
    t = list(map(lambda x: x*(-1), t))
    heapq.heapify(t)
    while m > 0:
        v = heapq.heappop(t) * -1
        heapq.heappush(t, (v // 2)* -1)
        m -= 1

    print(sum(t)*-1) main
import heapq
def main():
    n, m = list(map(int, input().split()))
    t = list(map(int, input().split()))
    t = list(map(lambda x: x*(-1), t))
    heapq.heapify(t)
    while m > 0:
        v = heapq.heappop(t) * -1
        heapq.heappush(t, (v // 2)* -1)
        m -= 1

    print(sum(t)*-1)


if __name__ == '__main__':
    main()