import bisect
import math

n,m = map(int,input().split())
a = list(map(int,input().split()))

a.sort()

ans = sum(a)
for i in range(m):
    tmp = a.pop()
    ans -= tmp
    cost = math.floor(tmp/2)
    ans += cost
    idx = bisect.bisect_left(a,cost)
    a.insert(idx,cost)

print(ans) import bisect bisect import math math 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 a.sort() a.sort a sort ans = sum(a) ans sum(a) sum a for i in range(m):
    tmp = a.pop()
    ans -= tmp
    cost = math.floor(tmp/2)
    ans += cost
    idx = bisect.bisect_left(a,cost)
    a.insert(idx,cost) i range(m) range m tmp = a.pop() tmp a.pop() a.pop a pop ans -= tmp ans tmp cost = math.floor(tmp/2) cost math.floor(tmp/2) math.floor math floor tmp/2 tmp 2 ans += cost ans cost idx = bisect.bisect_left(a,cost) idx bisect.bisect_left(a,cost) bisect.bisect_left bisect bisect_left a cost a.insert(idx,cost) a.insert a insert idx cost print(ans) print ans a = list(map(int,input().split())) list(map(int,input().split())) a ans = sum(a) sum(a) ans idx = bisect.bisect_left(a,cost) bisect.bisect_left(a,cost) idx m = map(int,input().split()) map(int,input().split()) m tmp = a.pop() a.pop() tmp cost = math.floor(tmp/2) math.floor(tmp/2) cost ans -= tmp tmp ans ans += cost cost ans n,m = map(int,input().split()) map(int,input().split()) n
import bisect
import math

n,m = map(int,input().split())
a = list(map(int,input().split()))

a.sort()

ans = sum(a)
for i in range(m):
    tmp = a.pop()
    ans -= tmp
    cost = math.floor(tmp/2)
    ans += cost
    idx = bisect.bisect_left(a,cost)
    a.insert(idx,cost)

print(ans)
