import heapq

def solve():
    N, M = map(int, input().split())
    A = list(map(lambda x: int(x) * -1, input().split()))
    
    heapq.heapify(A)
    
    for _ in range(M):
      t = heapq.heappop(A)
      heapq.heappush(A, -1*(-t//2))
    
    return -sum(A)

print(solve()) import heapq heapq def solve():
    N, M = map(int, input().split())
    A = list(map(lambda x: int(x) * -1, input().split()))
    
    heapq.heapify(A)
    
    for _ in range(M):
      t = heapq.heappop(A)
      heapq.heappush(A, -1*(-t//2))
    
    return -sum(A) solve N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M A = list(map(lambda x: int(x) * -1, input().split())) A list(map(lambda x: int(x) * -1, input().split())) list map(lambda x: int(x) * -1, input().split()) map lambda x: int(x) * -1 int(x) * -1 int(x) int x -1 x input().split() ().split () input split heapq.heapify(A) heapq.heapify heapq heapify A for _ in range(M):
      t = heapq.heappop(A)
      heapq.heappush(A, -1*(-t//2))
    
     _ range(M) range M t = heapq.heappop(A) t heapq.heappop(A) heapq.heappop heapq heappop A heapq.heappush(A, -1*(-t//2)) heapq.heappush heapq heappush A -1*(-t//2) -1 -t//2 -t t 2 return -sum(A) -sum(A) sum(A) sum A print(solve()) print solve() solve def solve():
    N, M = map(int, input().split())
    A = list(map(lambda x: int(x) * -1, input().split()))
    
    heapq.heapify(A)
    
    for _ in range(M):
      t = heapq.heappop(A)
      heapq.heappush(A, -1*(-t//2))
    
    return -sum(A) def solve():
    N, M = map(int, input().split())
    A = list(map(lambda x: int(x) * -1, input().split()))
    
    heapq.heapify(A)
    
    for _ in range(M):
      t = heapq.heappop(A)
      heapq.heappush(A, -1*(-t//2))
    
    return -sum(A) solve
import heapq

def solve():
    N, M = map(int, input().split())
    A = list(map(lambda x: int(x) * -1, input().split()))
    
    heapq.heapify(A)
    
    for _ in range(M):
      t = heapq.heappop(A)
      heapq.heappush(A, -1*(-t//2))
    
    return -sum(A)

print(solve())