from heapq import heapify, heappop, heappush

def resolve():
  N, M = map(int, input().split(" "))
  A = [(-1)*int(x) for x in input().split(" ")]
  heapify(A)

  for _ in range(M):
    max_A = (-1)*heappop(A)
    heappush(A, (-1)*(max_A//2))
  
  print((-1)*sum(A))

if __name__ == "__main__":
  resolve() from heapq import heapify, heappop, heappush def resolve():
  N, M = map(int, input().split(" "))
  A = [(-1)*int(x) for x in input().split(" ")]
  heapify(A)

  for _ in range(M):
    max_A = (-1)*heappop(A)
    heappush(A, (-1)*(max_A//2))
  
  print((-1)*sum(A)) resolve N, M = map(int, input().split(" ")) N map(int, input().split(" ")) map int input().split(" ") ().split () input split " " M (-1)*int(x) for x in input().split(" ") for x in input().split(" ") x input().split(" ") ().split () input split " " for x in input().split(" ") (-1)*int(x) -1 int(x) int x A = [(-1)*int(x) for x in input().split(" ")] A [(-1)*int(x) for x in input().split(" ")] heapify(A) heapify A for _ in range(M):
    max_A = (-1)*heappop(A)
    heappush(A, (-1)*(max_A//2))
  
   _ range(M) range M max_A = (-1)*heappop(A) max_A (-1)*heappop(A) -1 heappop(A) heappop A heappush(A, (-1)*(max_A//2)) heappush A (-1)*(max_A//2) -1 max_A//2 max_A 2 print((-1)*sum(A)) print (-1)*sum(A) -1 sum(A) sum A if __name__ == "__main__":
  resolve() __name__ == "__main__" __name__ "__main__" resolve() resolve def resolve():
  N, M = map(int, input().split(" "))
  A = [(-1)*int(x) for x in input().split(" ")]
  heapify(A)

  for _ in range(M):
    max_A = (-1)*heappop(A)
    heappush(A, (-1)*(max_A//2))
  
  print((-1)*sum(A)) def resolve():
  N, M = map(int, input().split(" "))
  A = [(-1)*int(x) for x in input().split(" ")]
  heapify(A)

  for _ in range(M):
    max_A = (-1)*heappop(A)
    heappush(A, (-1)*(max_A//2))
  
  print((-1)*sum(A)) resolve
from heapq import heapify, heappop, heappush

def resolve():
  N, M = map(int, input().split(" "))
  A = [(-1)*int(x) for x in input().split(" ")]
  heapify(A)

  for _ in range(M):
    max_A = (-1)*heappop(A)
    heappush(A, (-1)*(max_A//2))
  
  print((-1)*sum(A))

if __name__ == "__main__":
  resolve()