import sys
input=sys.stdin.readline #文字列入力はするな！！
import heapq
n,m=map(int,input().split())
a=list(map(int,input().split()))
for i in range(n):
    a[i]*=-1
a=sorted(a)
for i in range(m):
    h=-heapq.heappop(a)
    h=h//2
    heapq.heappush(a,-h)
print(-sum(a))
 import sys sys input=sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline import heapq heapq 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 for i in range(n):
    a[i]*=-1 i range(n) range n a[i]*=-1 a[i] a i -1 a=sorted(a) a sorted(a) sorted a for i in range(m):
    h=-heapq.heappop(a)
    h=h//2
    heapq.heappush(a,-h) i range(m) range m h=-heapq.heappop(a) h -heapq.heappop(a) heapq.heappop(a) heapq.heappop heapq heappop a h=h//2 h h//2 h 2 heapq.heappush(a,-h) heapq.heappush heapq heappush a -h h print(-sum(a)) print -sum(a) sum(a) sum a h=-heapq.heappop(a) -heapq.heappop(a) h n,m=map(int,input().split()) map(int,input().split()) n m=map(int,input().split()) map(int,input().split()) m h=h//2 h//2 h a=list(map(int,input().split())) list(map(int,input().split())) a a=sorted(a) sorted(a) a input=sys.stdin.readline sys.stdin.readline input
import sys
input=sys.stdin.readline #文字列入力はするな！！
import heapq
n,m=map(int,input().split())
a=list(map(int,input().split()))
for i in range(n):
    a[i]*=-1
a=sorted(a)
for i in range(m):
    h=-heapq.heappop(a)
    h=h//2
    heapq.heappush(a,-h)
print(-sum(a))

