import sys
# import math
# import bisect
# import numpy as np
# from decimal import Decimal
# from numba import njit, i8, u1, b1 #JIT compiler
# from itertools import combinations, product
# from collections import Counter, deque, defaultdict

# sys.setrecursionlimit(10 ** 6)
MOD = 10 ** 9 + 7
INF = 10 ** 9
PI = 3.14159265358979323846

def read_str():      return sys.stdin.readline().strip()
def read_int():      return int(sys.stdin.readline().strip())
def read_ints():     return map(int, sys.stdin.readline().strip().split())
def read_ints2(x):   return map(lambda num: int(num) - x, sys.stdin.readline().strip().split())
def read_str_list(): return list(sys.stdin.readline().strip().split())
def read_int_list(): return list(map(int, sys.stdin.readline().strip().split()))
def GCD(a: int, b: int) -> int: return b if a%b==0 else GCD(b, a%b)
def LCM(a: int, b: int) -> int: return (a * b) // GCD(a, b)

from heapq import heapify, heappop, heappush
def Main():
    n, m = read_ints()
    a = read_int_list()
    a = [-x for x in a]
    heapify(a)
    
    while m:
        cost = heappop(a)
        if cost == 0:
            break
        heappush(a, -(-cost//2))
        m -= 1
    print(-sum(a))

if __name__ == '__main__':
    Main() import sys sys MOD = 10 ** 9 + 7 MOD 10 ** 9 + 7 10 ** 9 10 9 7 INF = 10 ** 9 INF 10 ** 9 10 9 PI = 3.14159265358979323846 PI 3.14159265358979323846 def read_str():      return sys.stdin.readline().strip() read_str def read_int():      return int(sys.stdin.readline().strip()) read_int def read_ints():     return map(int, sys.stdin.readline().strip().split()) read_ints def read_ints2(x):   return map(lambda num: int(num) - x, sys.stdin.readline().strip().split()) read_ints2 x x def read_str_list(): return list(sys.stdin.readline().strip().split()) read_str_list def read_int_list(): return list(map(int, sys.stdin.readline().strip().split())) read_int_list def GCD(a: int, b: int) -> int: return b if a%b==0 else GCD(b, a%b) GCD a: int a b: int b def LCM(a: int, b: int) -> int: return (a * b) // GCD(a, b) LCM a: int a b: int b from heapq import heapify, heappop, heappush def Main():
    n, m = read_ints()
    a = read_int_list()
    a = [-x for x in a]
    heapify(a)
    
    while m:
        cost = heappop(a)
        if cost == 0:
            break
        heappush(a, -(-cost//2))
        m -= 1
    print(-sum(a)) Main n, m = read_ints() n read_ints() read_ints m a = read_int_list() a read_int_list() read_int_list -x for x in a for x in a x a for x in a -x x a = [-x for x in a] a [-x for x in a] heapify(a) heapify a while m:
        cost = heappop(a)
        if cost == 0:
            break
        heappush(a, -(-cost//2))
        m -= 1
     m cost = heappop(a) cost heappop(a) heappop a if cost == 0:
            break
         cost == 0 cost 0 break heappush(a, -(-cost//2)) heappush a -(-cost//2) -cost//2 -cost cost 2 m -= 1 m 1 print(-sum(a)) print -sum(a) sum(a) sum a if __name__ == '__main__':
    Main() __name__ == '__main__' __name__ '__main__' Main() Main INF = 10 ** 9 10 ** 9 INF def GCD(a: int, b: int) -> int: return b if a%b==0 else GCD(b, a%b) def GCD(a: int, b: int) -> int: return b if a%b==0 else GCD(b, a%b) GCD def LCM(a: int, b: int) -> int: return (a * b) // GCD(a, b) def LCM(a: int, b: int) -> int: return (a * b) // GCD(a, b) LCM def read_str():      return sys.stdin.readline().strip() def read_str():      return sys.stdin.readline().strip() read_str MOD = 10 ** 9 + 7 10 ** 9 + 7 MOD def read_int_list(): return list(map(int, sys.stdin.readline().strip().split())) def read_int_list(): return list(map(int, sys.stdin.readline().strip().split())) read_int_list def Main():
    n, m = read_ints()
    a = read_int_list()
    a = [-x for x in a]
    heapify(a)
    
    while m:
        cost = heappop(a)
        if cost == 0:
            break
        heappush(a, -(-cost//2))
        m -= 1
    print(-sum(a)) def Main():
    n, m = read_ints()
    a = read_int_list()
    a = [-x for x in a]
    heapify(a)
    
    while m:
        cost = heappop(a)
        if cost == 0:
            break
        heappush(a, -(-cost//2))
        m -= 1
    print(-sum(a)) Main PI = 3.14159265358979323846 3.14159265358979323846 PI def read_ints():     return map(int, sys.stdin.readline().strip().split()) def read_ints():     return map(int, sys.stdin.readline().strip().split()) read_ints def read_ints2(x):   return map(lambda num: int(num) - x, sys.stdin.readline().strip().split()) def read_ints2(x):   return map(lambda num: int(num) - x, sys.stdin.readline().strip().split()) read_ints2 def read_str_list(): return list(sys.stdin.readline().strip().split()) def read_str_list(): return list(sys.stdin.readline().strip().split()) read_str_list def read_int():      return int(sys.stdin.readline().strip()) def read_int():      return int(sys.stdin.readline().strip()) read_int
import sys
# import math
# import bisect
# import numpy as np
# from decimal import Decimal
# from numba import njit, i8, u1, b1 #JIT compiler
# from itertools import combinations, product
# from collections import Counter, deque, defaultdict

# sys.setrecursionlimit(10 ** 6)
MOD = 10 ** 9 + 7
INF = 10 ** 9
PI = 3.14159265358979323846

def read_str():      return sys.stdin.readline().strip()
def read_int():      return int(sys.stdin.readline().strip())
def read_ints():     return map(int, sys.stdin.readline().strip().split())
def read_ints2(x):   return map(lambda num: int(num) - x, sys.stdin.readline().strip().split())
def read_str_list(): return list(sys.stdin.readline().strip().split())
def read_int_list(): return list(map(int, sys.stdin.readline().strip().split()))
def GCD(a: int, b: int) -> int: return b if a%b==0 else GCD(b, a%b)
def LCM(a: int, b: int) -> int: return (a * b) // GCD(a, b)

from heapq import heapify, heappop, heappush
def Main():
    n, m = read_ints()
    a = read_int_list()
    a = [-x for x in a]
    heapify(a)
    
    while m:
        cost = heappop(a)
        if cost == 0:
            break
        heappush(a, -(-cost//2))
        m -= 1
    print(-sum(a))

if __name__ == '__main__':
    Main()