import heapq
t = 1
# t = input()
# t = int(t)
def max(a,b):
	if a > b:
		return a
	return b
while t > 0:
	t -= 1
	# s = input()
	# ans = ""
	# if s == "Sunny":
	# 	ans = "Cloudy"
	# elif s == "Cloudy":
	# 	ans = "Rainy"
	# else:
	# 	ans = "Sunny"
	# print(ans)
	n,m = map(int,input().split())	
	v = list(map(int,input().strip().split()))[0:n]
	for i in range(n):
		v[i] = -v[i]
	heapq.heapify(v)
	for i in range(m):
		x = heapq.heappop(v)
		x = -x
		x = x//2
		heapq.heappush(v,-x)
	ans = 0
	for i in range(n):
		ans += (-heapq.heappop(v))
	print(ans)
	# # m = {}
	# l = []
	# for i in range(n):
	# 	l.append(0)
	# # ans = 0
	# j = 1
	# for i in v:
	# 	l[i-1] = j
	# 	j += 1
	# # print(ans)
	# for i in l:
	# 	print(i,end=" ") import heapq heapq t = 1 t 1 def max(a,b):
	if a > b:
		return a
	return b max if a > b:
		return a
	 a > b a b return a a return b b a a b b while t > 0:
	t -= 1
	# s = input()
	# ans = ""
	# if s == "Sunny":
	# 	ans = "Cloudy"
	# elif s == "Cloudy":
	# 	ans = "Rainy"
	# else:
	# 	ans = "Sunny"
	# print(ans)
	n,m = map(int,input().split())	
	v = list(map(int,input().strip().split()))[0:n]
	for i in range(n):
		v[i] = -v[i]
	heapq.heapify(v)
	for i in range(m):
		x = heapq.heappop(v)
		x = -x
		x = x//2
		heapq.heappush(v,-x)
	ans = 0
	for i in range(n):
		ans += (-heapq.heappop(v))
	print(ans)
	# # m = {}
	# l = []
	# for i in range(n):
	# 	l.append(0)
	# # ans = 0
	# j = 1
	# for i in v:
	# 	l[i-1] = j
	# 	j += 1
	# # print(ans)
	# for i in l:
	# 	print(i,end=" ") t > 0 t 0 t -= 1 t 1 n,m = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split m v = list(map(int,input().strip().split()))[0:n] v list(map(int,input().strip().split()))[0:n] (map(int,input().strip().split())) list map(int,input().strip().split()) map int input().strip().split() ().strip().split ().strip() ().strip () input strip split 0:n 0 n for i in range(n):
		v[i] = -v[i]
	 i range(n) range n v[i] = -v[i] v[i] v i -v[i] v[i] v i heapq.heapify(v) heapq.heapify heapq heapify v for i in range(m):
		x = heapq.heappop(v)
		x = -x
		x = x//2
		heapq.heappush(v,-x)
	 i range(m) range m x = heapq.heappop(v) x heapq.heappop(v) heapq.heappop heapq heappop v x = -x x -x x x = x//2 x x//2 x 2 heapq.heappush(v,-x) heapq.heappush heapq heappush v -x x ans = 0 ans 0 for i in range(n):
		ans += (-heapq.heappop(v))
	 i range(n) range n ans += (-heapq.heappop(v)) ans -heapq.heappop(v) heapq.heappop(v) heapq.heappop heapq heappop v print(ans) print ans t = 1 1 t m = map(int,input().split()) map(int,input().split()) m x = x//2 x//2 x t -= 1 1 t v = list(map(int,input().strip().split()))[0:n] list(map(int,input().strip().split()))[0:n] v x = heapq.heappop(v) heapq.heappop(v) x ans += (-heapq.heappop(v)) -heapq.heappop(v) ans n,m = map(int,input().split()) map(int,input().split()) n x = -x -x x ans = 0 0 ans def max(a,b):
	if a > b:
		return a
	return b def max(a,b):
	if a > b:
		return a
	return b max
import heapq
t = 1
# t = input()
# t = int(t)
def max(a,b):
	if a > b:
		return a
	return b
while t > 0:
	t -= 1
	# s = input()
	# ans = ""
	# if s == "Sunny":
	# 	ans = "Cloudy"
	# elif s == "Cloudy":
	# 	ans = "Rainy"
	# else:
	# 	ans = "Sunny"
	# print(ans)
	n,m = map(int,input().split())	
	v = list(map(int,input().strip().split()))[0:n]
	for i in range(n):
		v[i] = -v[i]
	heapq.heapify(v)
	for i in range(m):
		x = heapq.heappop(v)
		x = -x
		x = x//2
		heapq.heappush(v,-x)
	ans = 0
	for i in range(n):
		ans += (-heapq.heappop(v))
	print(ans)
	# # m = {}
	# l = []
	# for i in range(n):
	# 	l.append(0)
	# # ans = 0
	# j = 1
	# for i in v:
	# 	l[i-1] = j
	# 	j += 1
	# # print(ans)
	# for i in l:
	# 	print(i,end=" ")
