# -*- coding: utf-8 -*-
"""
Created on Wed Sep 16 17:42:18 2020

@author: liang
"""
"""
【優先度付きキュー】
・ヒープ構造の部分順序付き木
・挿入、削除、最大値（最小値）の取り出し、要素の値の変更
　⇒　O(log n)
・ヒープ生成
　⇒O(n)
 【使い方】
  import heapq
  ●heapq.heapify(list) #最小値
  ●heapq.heapify(list(map(lambda x:int(x)*(-1),list))) #最大値は値をひっくり返す
  ●heapq.heappop(a)
  ●heapq.heappush(a,1)
"""

import heapq
N, M = map(int, input().split())
# -1倍する
A = [int(x)*(-1) for x in input().split()]
heapq.heapify(A)

#O(M) * O(log N)
for i in range(M):
    Max = heapq.heappop(A) * (-1)
    Max //= 2
    heapq.heappush(A, Max*(-1))
print(-sum(A)) """
Created on Wed Sep 16 17:42:18 2020

@author: liang
""" """
【優先度付きキュー】
・ヒープ構造の部分順序付き木
・挿入、削除、最大値（最小値）の取り出し、要素の値の変更
　⇒　O(log n)
・ヒープ生成
　⇒O(n)
 【使い方】
  import heapq
  ●heapq.heapify(list) #最小値
  ●heapq.heapify(list(map(lambda x:int(x)*(-1),list))) #最大値は値をひっくり返す
  ●heapq.heappop(a)
  ●heapq.heappush(a,1)
""" import heapq heapq N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M int(x)*(-1) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x)*(-1) int(x) int x -1 A = [int(x)*(-1) for x in input().split()] A [int(x)*(-1) for x in input().split()] heapq.heapify(A) heapq.heapify heapq heapify A for i in range(M):
    Max = heapq.heappop(A) * (-1)
    Max //= 2
    heapq.heappush(A, Max*(-1)) i range(M) range M Max = heapq.heappop(A) * (-1) Max heapq.heappop(A) * (-1) heapq.heappop(A) heapq.heappop heapq heappop A -1 Max //= 2 Max 2 heapq.heappush(A, Max*(-1)) heapq.heappush heapq heappush A Max*(-1) Max -1 print(-sum(A)) print -sum(A) sum(A) sum A N, M = map(int, input().split()) map(int, input().split()) N Max = heapq.heappop(A) * (-1) heapq.heappop(A) * (-1) Max Max //= 2 2 Max M = map(int, input().split()) map(int, input().split()) M A = [int(x)*(-1) for x in input().split()] [int(x)*(-1) for x in input().split()] A
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 16 17:42:18 2020

@author: liang
"""
"""
【優先度付きキュー】
・ヒープ構造の部分順序付き木
・挿入、削除、最大値（最小値）の取り出し、要素の値の変更
　⇒　O(log n)
・ヒープ生成
　⇒O(n)
 【使い方】
  import heapq
  ●heapq.heapify(list) #最小値
  ●heapq.heapify(list(map(lambda x:int(x)*(-1),list))) #最大値は値をひっくり返す
  ●heapq.heappop(a)
  ●heapq.heappush(a,1)
"""

import heapq
N, M = map(int, input().split())
# -1倍する
A = [int(x)*(-1) for x in input().split()]
heapq.heapify(A)

#O(M) * O(log N)
for i in range(M):
    Max = heapq.heappop(A) * (-1)
    Max //= 2
    heapq.heappush(A, Max*(-1))
print(-sum(A))