def main():

    import sys

    input = sys.stdin.readline

    sys.setrecursionlimit(10**7)

    from collections import Counter, deque

    #from collections import defaultdict

    from itertools import combinations, permutations, accumulate, groupby

    #from itertools import product

    from bisect import bisect_left,bisect_right

    from heapq import heapify, heappop, heappush

    from math import floor, ceil

    #from operator import itemgetter



    #inf = 10**17

    #mod = 10**9 + 7



    n,m = list(map(int, input().split()))

    a = list(map(int, input().split()))

    for i in range(n):

        a[i] = -a[i]

    heapify(a)

    for _ in range(m):

        b = heappop(a)

        b = -(-b // 2)

        heappush(a, b)

    print((-sum(a)))









if __name__ == '__main__':

    main()
def main():

    import sys

    input = sys.stdin.readline

    sys.setrecursionlimit(10**7)

    from collections import Counter, deque

    #from collections import defaultdict

    from itertools import combinations, permutations, accumulate, groupby, product

    from bisect import bisect_left,bisect_right

    from heapq import heapify, heappop, heappush

    from math import floor, ceil

    #from operator import itemgetter



    #inf = 10**17

    #mod = 10**9 + 7



    n,m = list(map(int, input().split()))

    a = list(map(int, input().split()))

    for i in range(n):

        a[i] *= -1



    heapify(a)

    while m:

        b = heappop(a)

        b = (-b)//2

        heappush(a, -b)

        m -= 1

    print((-sum(a)))



if __name__ == '__main__':

    main()
def main():
    import sys

    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque

    # from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby

    # from itertools import product
    from bisect import bisect_left, bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil

    # from operator import itemgetter
    # inf = 10**17
    # mod = 10**9 + 7
    n, m = list(map(int, input().split()))
    a = list(map(int, input().split()))
    for i in range(n):
        a[i] = -a[i]
    heapify(a)
    for _ in range(m):
        b = heappop(a)
        b = -(-b // 2)
        heappush(a, b)
    print((-sum(a)))


if __name__ == "__main__":
    main()

def main():
    import sys

    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque

    # from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left, bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil

    # from operator import itemgetter
    # inf = 10**17
    # mod = 10**9 + 7
    n, m = list(map(int, input().split()))
    a = list(map(int, input().split()))
    for i in range(n):
        a[i] *= -1
    heapify(a)
    while m:
        b = heappop(a)
        b = (-b) // 2
        heappush(a, -b)
        m -= 1
    print((-sum(a)))


if __name__ == "__main__":
    main()

-    from itertools import combinations, permutations, accumulate, groupby - -    # from itertools import product +    from itertools import combinations, permutations, accumulate, groupby, product -        a[i] = -a[i] +        a[i] *= -1 -    for _ in range(m): +    while m: -        b = -(-b // 2) -        heappush(a, b) +        b = (-b) // 2 +        heappush(a, -b) +        m -= 1