import math
import heapq
n,m = map(int, raw_input().split(' '))

heap = [-e for  e in map(int, raw_input().split(' '))]
heapq.heapify(heap)
while(m and heap):
	u = heapq.heappop(heap)
	u *= -1
	u /=2
	if u:
		heapq.heappush(heap, -u)
	m-=1
	"""

	q = int(math.ceil(math.log(u,2)))
	if 2 ** q <= u: q +=1
	if q <= m:
		m-= q
	else:
		u /= 2
		m -=1
		if u:
			heapq.heappush(heap, -u)

	"""
print -sum(heap or [0]) import math math import heapq heapq n,m = map(int, raw_input().split(' ')) n map(int, raw_input().split(' ')) map int raw_input().split(' ') ().split () raw_input split ' ' m -e for  e in map(int, raw_input().split(' ')) for  e in map(int, raw_input().split(' ')) e map(int, raw_input().split(' ')) map int raw_input().split(' ') ().split () raw_input split ' ' for  e in map(int, raw_input().split(' ')) -e e heap = [-e for  e in map(int, raw_input().split(' '))] heap [-e for  e in map(int, raw_input().split(' '))] heapq.heapify(heap) heapq.heapify heapq heapify heap while(m and heap):
	u = heapq.heappop(heap)
	u *= -1
	u /=2
	if u:
		heapq.heappush(heap, -u)
	m-=1
	"""

	q = int(math.ceil(math.log(u,2)))
	if 2 ** q <= u: q +=1
	if q <= m:
		m-= q
	else:
		u /= 2
		m -=1
		if u:
			heapq.heappush(heap, -u)

	""" m and heap m heap u = heapq.heappop(heap) u heapq.heappop(heap) heapq.heappop heapq heappop heap u *= -1 u -1 u /=2 u 2 if u:
		heapq.heappush(heap, -u)
	 u heapq.heappush(heap, -u) heapq.heappush heapq heappush heap -u u m-=1 m 1 """

	q = int(math.ceil(math.log(u,2)))
	if 2 ** q <= u: q +=1
	if q <= m:
		m-= q
	else:
		u /= 2
		m -=1
		if u:
			heapq.heappush(heap, -u)

	""" print -sum(heap or [0]) print sum(heap or [0]) sum heap or [0] heap [0] 0 m = map(int, raw_input().split(' ')) map(int, raw_input().split(' ')) m u = heapq.heappop(heap) heapq.heappop(heap) u u /=2 2 u m-=1 1 m n,m = map(int, raw_input().split(' ')) map(int, raw_input().split(' ')) n heap = [-e for  e in map(int, raw_input().split(' '))] [-e for  e in map(int, raw_input().split(' '))] heap u *= -1 -1 u
import math
import heapq
n,m = map(int, raw_input().split(' '))

heap = [-e for  e in map(int, raw_input().split(' '))]
heapq.heapify(heap)
while(m and heap):
	u = heapq.heappop(heap)
	u *= -1
	u /=2
	if u:
		heapq.heappush(heap, -u)
	m-=1
	"""

	q = int(math.ceil(math.log(u,2)))
	if 2 ** q <= u: q +=1
	if q <= m:
		m-= q
	else:
		u /= 2
		m -=1
		if u:
			heapq.heappush(heap, -u)

	"""
print -sum(heap or [0])
