# -*- coding: utf-8 -*-

"""

Created on Wed Oct  2 07:56:16 2019



@author: avina

"""

from queue import PriorityQueue as Q

n,t = list(map(int,input().split()))



q = Q()

for i in input().split():

    a = -1*int(i)

    q.put(a)



while t >0:

    a = -1*(q.get())

    a = -1*(a//2)

    q.put(a)

    t-=1



ans = 0

while q.qsize()>0:

    ans += q.get()

print((-1*ans))
# -*- coding: utf-8 -*-

"""

Created on Thu Oct  3 07:43:37 2019



@author: avina

"""



import heapq



class Maxheap():

    

    def __init__(self, x):

        self.heap = [-e for e in x]

        heapq.heapify(self.heap)

    

    def push(self, value):

        heapq.heappush(self.heap, -value)

    

    def pop(self):

        return -heapq.heappop(self.heap)



n,t = list(map(int, input().split()))



l = list(map(int, input().split()))

a = Maxheap(l)

for i in range(t):

    b = a.pop()//2

    a.push(b)

    

sums = 0

for i in range(n):

    sums += a.pop()

print(sums)
# -*- coding: utf-8 -*-
"""
Created on Wed Oct  2 07:56:16 2019
@author: avina
"""
from queue import PriorityQueue as Q

n, t = list(map(int, input().split()))
q = Q()
for i in input().split():
    a = -1 * int(i)
    q.put(a)
while t > 0:
    a = -1 * (q.get())
    a = -1 * (a // 2)
    q.put(a)
    t -= 1
ans = 0
while q.qsize() > 0:
    ans += q.get()
print((-1 * ans))

# -*- coding: utf-8 -*-
"""
Created on Thu Oct  3 07:43:37 2019
@author: avina
"""
import heapq


class Maxheap:
    def __init__(self, x):
        self.heap = [-e for e in x]
        heapq.heapify(self.heap)

    def push(self, value):
        heapq.heappush(self.heap, -value)

    def pop(self):
        return -heapq.heappop(self.heap)


n, t = list(map(int, input().split()))
l = list(map(int, input().split()))
a = Maxheap(l)
for i in range(t):
    b = a.pop() // 2
    a.push(b)
sums = 0
for i in range(n):
    sums += a.pop()
print(sums)

-Created on Wed Oct  2 07:56:16 2019 +Created on Thu Oct  3 07:43:37 2019 -from queue import PriorityQueue as Q +import heapq + + +class Maxheap: +    def __init__(self, x): +        self.heap = [-e for e in x] +        heapq.heapify(self.heap) + +    def push(self, value): +        heapq.heappush(self.heap, -value) + +    def pop(self): +        return -heapq.heappop(self.heap) + -q = Q() -for i in input().split(): -    a = -1 * int(i) -    q.put(a) -while t > 0: -    a = -1 * (q.get()) -    a = -1 * (a // 2) -    q.put(a) -    t -= 1 -ans = 0 -while q.qsize() > 0: -    ans += q.get() -print((-1 * ans)) +l = list(map(int, input().split())) +a = Maxheap(l) +for i in range(t): +    b = a.pop() // 2 +    a.push(b) +sums = 0 +for i in range(n): +    sums += a.pop() +print(sums)