#!/usr/bin/env python3
import sys
import heapq


def II():
    return int(sys.stdin.readline())


def MI():
    return map(int, sys.stdin.readline().split())


def LI():
    return list(map(int, sys.stdin.readline().split()))


def main():
    n, m = MI()
    a = LI()
    heap = []
    for i in range(n):
        heapq.heappush(heap, a[i] * -1)

    while m > 0:
        min_ = heapq.heappop(heap) * -1
        min_ = (min_ // 2) * -1
        heapq.heappush(heap, min_)
        m -= 1
    print(sum(heap) * -1)


main() import sys sys import heapq heapq def II():
    return int(sys.stdin.readline()) II return int(sys.stdin.readline()) int(sys.stdin.readline()) int sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline def MI():
    return map(int, sys.stdin.readline().split()) MI return map(int, sys.stdin.readline().split()) map(int, sys.stdin.readline().split()) map int sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split def LI():
    return list(map(int, sys.stdin.readline().split())) LI return list(map(int, sys.stdin.readline().split())) list(map(int, sys.stdin.readline().split())) list map(int, sys.stdin.readline().split()) map int sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split def main():
    n, m = MI()
    a = LI()
    heap = []
    for i in range(n):
        heapq.heappush(heap, a[i] * -1)

    while m > 0:
        min_ = heapq.heappop(heap) * -1
        min_ = (min_ // 2) * -1
        heapq.heappush(heap, min_)
        m -= 1
    print(sum(heap) * -1) main n, m = MI() n MI() MI m a = LI() a LI() LI heap = [] heap [] for i in range(n):
        heapq.heappush(heap, a[i] * -1)

     i range(n) range n heapq.heappush(heap, a[i] * -1) heapq.heappush heapq heappush heap a[i] * -1 a[i] a i -1 while m > 0:
        min_ = heapq.heappop(heap) * -1
        min_ = (min_ // 2) * -1
        heapq.heappush(heap, min_)
        m -= 1
     m > 0 m 0 min_ = heapq.heappop(heap) * -1 min_ heapq.heappop(heap) * -1 heapq.heappop(heap) heapq.heappop heapq heappop heap -1 min_ = (min_ // 2) * -1 min_ (min_ // 2) * -1 min_ // 2 min_ 2 -1 heapq.heappush(heap, min_) heapq.heappush heapq heappush heap min_ m -= 1 m 1 print(sum(heap) * -1) print sum(heap) * -1 sum(heap) sum heap -1 main() main def II():
    return int(sys.stdin.readline()) def II():
    return int(sys.stdin.readline()) II def main():
    n, m = MI()
    a = LI()
    heap = []
    for i in range(n):
        heapq.heappush(heap, a[i] * -1)

    while m > 0:
        min_ = heapq.heappop(heap) * -1
        min_ = (min_ // 2) * -1
        heapq.heappush(heap, min_)
        m -= 1
    print(sum(heap) * -1) def main():
    n, m = MI()
    a = LI()
    heap = []
    for i in range(n):
        heapq.heappush(heap, a[i] * -1)

    while m > 0:
        min_ = heapq.heappop(heap) * -1
        min_ = (min_ // 2) * -1
        heapq.heappush(heap, min_)
        m -= 1
    print(sum(heap) * -1) main def MI():
    return map(int, sys.stdin.readline().split()) def MI():
    return map(int, sys.stdin.readline().split()) MI def LI():
    return list(map(int, sys.stdin.readline().split())) def LI():
    return list(map(int, sys.stdin.readline().split())) LI
#!/usr/bin/env python3
import sys
import heapq


def II():
    return int(sys.stdin.readline())


def MI():
    return map(int, sys.stdin.readline().split())


def LI():
    return list(map(int, sys.stdin.readline().split()))


def main():
    n, m = MI()
    a = LI()
    heap = []
    for i in range(n):
        heapq.heappush(heap, a[i] * -1)

    while m > 0:
        min_ = heapq.heappop(heap) * -1
        min_ = (min_ // 2) * -1
        heapq.heappush(heap, min_)
        m -= 1
    print(sum(heap) * -1)


main()
