import sys
import itertools
# import numpy as np
import time
import math
 
sys.setrecursionlimit(10 ** 7)
 
from collections import defaultdict
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, M = map(int, readline().split())
A = map(int, readline().split())

import heapq
q = []
for a in A:
    heapq.heappush(q, -a)

while M > 0:
    a = -heapq.heappop(q)
    a //= 2
    heapq.heappush(q, -a)
    M -= 1

ans = 0
while len(q) > 0:
    ans += abs(heapq.heappop(q))
print(ans) import sys sys import itertools itertools import time time import math math sys.setrecursionlimit(10 ** 7) sys.setrecursionlimit sys setrecursionlimit 10 ** 7 10 7 from collections import defaultdict read = sys.stdin.buffer.read read sys.stdin.buffer.read sys.stdin.buffer sys.stdin sys stdin buffer read readline = sys.stdin.buffer.readline readline sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline readlines = sys.stdin.buffer.readlines readlines sys.stdin.buffer.readlines sys.stdin.buffer sys.stdin sys stdin buffer readlines N, M = map(int, readline().split()) N map(int, readline().split()) map int readline().split() ().split () readline split M A = map(int, readline().split()) A map(int, readline().split()) map int readline().split() ().split () readline split import heapq heapq q = [] q [] for a in A:
    heapq.heappush(q, -a) a A heapq.heappush(q, -a) heapq.heappush heapq heappush q -a a while M > 0:
    a = -heapq.heappop(q)
    a //= 2
    heapq.heappush(q, -a)
    M -= 1 M > 0 M 0 a = -heapq.heappop(q) a -heapq.heappop(q) heapq.heappop(q) heapq.heappop heapq heappop q a //= 2 a 2 heapq.heappush(q, -a) heapq.heappush heapq heappush q -a a M -= 1 M 1 ans = 0 ans 0 while len(q) > 0:
    ans += abs(heapq.heappop(q)) len(q) > 0 len(q) len q 0 ans += abs(heapq.heappop(q)) ans abs(heapq.heappop(q)) abs heapq.heappop(q) heapq.heappop heapq heappop q print(ans) print ans a = -heapq.heappop(q) -heapq.heappop(q) a a //= 2 2 a read = sys.stdin.buffer.read sys.stdin.buffer.read read readlines = sys.stdin.buffer.readlines sys.stdin.buffer.readlines readlines M = map(int, readline().split()) map(int, readline().split()) M M -= 1 1 M ans += abs(heapq.heappop(q)) abs(heapq.heappop(q)) ans ans = 0 0 ans q = [] [] q readline = sys.stdin.buffer.readline sys.stdin.buffer.readline readline N, M = map(int, readline().split()) map(int, readline().split()) N A = map(int, readline().split()) map(int, readline().split()) A
import sys
import itertools
# import numpy as np
import time
import math
 
sys.setrecursionlimit(10 ** 7)
 
from collections import defaultdict
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, M = map(int, readline().split())
A = map(int, readline().split())

import heapq
q = []
for a in A:
    heapq.heappush(q, -a)

while M > 0:
    a = -heapq.heappop(q)
    a //= 2
    heapq.heappush(q, -a)
    M -= 1

ans = 0
while len(q) > 0:
    ans += abs(heapq.heappop(q))
print(ans)
