# -*- coding: utf-8 -*-
"""
Created on Wed Jun  3 18:35:23 2020

@author: NEC-PCuser
"""
import heapq

N, M = map(int, input().split())
A = [-int(n) for n in input().split(" ")]

heapq.heapify(A)

for i in range(M):
    most_expensive = -heapq.heappop(A)
    most_expensive //= 2
    heapq.heappush(A, -most_expensive)
    
print(-sum(A)) """
Created on Wed Jun  3 18:35:23 2020

@author: NEC-PCuser
""" import heapq heapq N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M -int(n) for n in input().split(" ") for n in input().split(" ") n input().split(" ") ().split () input split " " for n in input().split(" ") -int(n) int(n) int n A = [-int(n) for n in input().split(" ")] A [-int(n) for n in input().split(" ")] heapq.heapify(A) heapq.heapify heapq heapify A for i in range(M):
    most_expensive = -heapq.heappop(A)
    most_expensive //= 2
    heapq.heappush(A, -most_expensive)
     i range(M) range M most_expensive = -heapq.heappop(A) most_expensive -heapq.heappop(A) heapq.heappop(A) heapq.heappop heapq heappop A most_expensive //= 2 most_expensive 2 heapq.heappush(A, -most_expensive) heapq.heappush heapq heappush A -most_expensive most_expensive print(-sum(A)) print -sum(A) sum(A) sum A most_expensive = -heapq.heappop(A) -heapq.heappop(A) most_expensive M = map(int, input().split()) map(int, input().split()) M A = [-int(n) for n in input().split(" ")] [-int(n) for n in input().split(" ")] A most_expensive //= 2 2 most_expensive N, M = map(int, input().split()) map(int, input().split()) N
# -*- coding: utf-8 -*-
"""
Created on Wed Jun  3 18:35:23 2020

@author: NEC-PCuser
"""
import heapq

N, M = map(int, input().split())
A = [-int(n) for n in input().split(" ")]

heapq.heapify(A)

for i in range(M):
    most_expensive = -heapq.heappop(A)
    most_expensive //= 2
    heapq.heappush(A, -most_expensive)
    
print(-sum(A))