from heapq import heapify, heappush, heappop

def main():
    n, m = map(int, input().split())
    a = [int(x)*-1 for x in input().split()]
    ans = sum(a)*-1
    diff = 0
    
    heapify(a)
    for _ in range(1, m+1):
        _h_a = heappop(a) * -1
        diff += _h_a - _h_a // 2
        heappush(a, (_h_a // 2)*-1)
    ans -= diff
    print(ans)
    
if __name__ == '__main__':
    main() from heapq import heapify, heappush, heappop def main():
    n, m = map(int, input().split())
    a = [int(x)*-1 for x in input().split()]
    ans = sum(a)*-1
    diff = 0
    
    heapify(a)
    for _ in range(1, m+1):
        _h_a = heappop(a) * -1
        diff += _h_a - _h_a // 2
        heappush(a, (_h_a // 2)*-1)
    ans -= diff
    print(ans)
     main n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m int(x)*-1 for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x)*-1 int(x) int x -1 a = [int(x)*-1 for x in input().split()] a [int(x)*-1 for x in input().split()] ans = sum(a)*-1 ans sum(a)*-1 sum(a) sum a -1 diff = 0 diff 0 heapify(a) heapify a for _ in range(1, m+1):
        _h_a = heappop(a) * -1
        diff += _h_a - _h_a // 2
        heappush(a, (_h_a // 2)*-1)
     _ range(1, m+1) range 1 m+1 m 1 _h_a = heappop(a) * -1 _h_a heappop(a) * -1 heappop(a) heappop a -1 diff += _h_a - _h_a // 2 diff _h_a - _h_a // 2 _h_a _h_a // 2 _h_a 2 heappush(a, (_h_a // 2)*-1) heappush a (_h_a // 2)*-1 _h_a // 2 _h_a 2 -1 ans -= diff ans diff print(ans) print ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    n, m = map(int, input().split())
    a = [int(x)*-1 for x in input().split()]
    ans = sum(a)*-1
    diff = 0
    
    heapify(a)
    for _ in range(1, m+1):
        _h_a = heappop(a) * -1
        diff += _h_a - _h_a // 2
        heappush(a, (_h_a // 2)*-1)
    ans -= diff
    print(ans)
     def main():
    n, m = map(int, input().split())
    a = [int(x)*-1 for x in input().split()]
    ans = sum(a)*-1
    diff = 0
    
    heapify(a)
    for _ in range(1, m+1):
        _h_a = heappop(a) * -1
        diff += _h_a - _h_a // 2
        heappush(a, (_h_a // 2)*-1)
    ans -= diff
    print(ans)
     main
from heapq import heapify, heappush, heappop

def main():
    n, m = map(int, input().split())
    a = [int(x)*-1 for x in input().split()]
    ans = sum(a)*-1
    diff = 0
    
    heapify(a)
    for _ in range(1, m+1):
        _h_a = heappop(a) * -1
        diff += _h_a - _h_a // 2
        heappush(a, (_h_a // 2)*-1)
    ans -= diff
    print(ans)
    
if __name__ == '__main__':
    main()