# import sys
# sys.setrecursionlimit(10 ** 6)
import bisect
# from collections import deque
# from decorator import stop_watch
#
#
# @stop_watch
def solve(N, M, As):
    prices = sorted(As, reverse=True) + [0]
    halfed_idx = []
    n = 0
    idx = 0
    for _ in range(M):
        if len(halfed_idx) == 0:
            prices[n] //= 2
            halfed_idx.append(n)
            n += 1
        else:
            if prices[n] > prices[halfed_idx[idx]]:
                prices[n] //= 2
                halfed_idx.append(n)
                n += 1
            else:
                prices[halfed_idx[idx]] //= 2
                halfed_idx.append(halfed_idx[idx])
                idx += 1
    print(sum(prices))


def solve2(N, M, As):
    """later (ave 2.3 second)"""
    As.sort()
    for i in range(M):
        p = As.pop() // 2
        As.insert(bisect.bisect_right(As, p), p)
    print(sum(As))


if __name__ == '__main__':
    N, M = map(int, input().split())
    As = [int(i) for i in input().split()]

    # N, M = 10 ** 5, 10 ** 5
    # from random import randint
    # As = [randint(1, 10 ** 9) for _ in range(N)]
    solve(N, M, As)
    # solve2(N, M, As) import bisect bisect def solve(N, M, As):
    prices = sorted(As, reverse=True) + [0]
    halfed_idx = []
    n = 0
    idx = 0
    for _ in range(M):
        if len(halfed_idx) == 0:
            prices[n] //= 2
            halfed_idx.append(n)
            n += 1
        else:
            if prices[n] > prices[halfed_idx[idx]]:
                prices[n] //= 2
                halfed_idx.append(n)
                n += 1
            else:
                prices[halfed_idx[idx]] //= 2
                halfed_idx.append(halfed_idx[idx])
                idx += 1
    print(sum(prices)) solve prices = sorted(As, reverse=True) + [0] prices sorted(As, reverse=True) + [0] sorted(As, reverse=True) sorted As reverse=True reverse True [0] 0 halfed_idx = [] halfed_idx [] n = 0 n 0 idx = 0 idx 0 for _ in range(M):
        if len(halfed_idx) == 0:
            prices[n] //= 2
            halfed_idx.append(n)
            n += 1
        else:
            if prices[n] > prices[halfed_idx[idx]]:
                prices[n] //= 2
                halfed_idx.append(n)
                n += 1
            else:
                prices[halfed_idx[idx]] //= 2
                halfed_idx.append(halfed_idx[idx])
                idx += 1
     _ range(M) range M if len(halfed_idx) == 0:
            prices[n] //= 2
            halfed_idx.append(n)
            n += 1
        else:
            if prices[n] > prices[halfed_idx[idx]]:
                prices[n] //= 2
                halfed_idx.append(n)
                n += 1
            else:
                prices[halfed_idx[idx]] //= 2
                halfed_idx.append(halfed_idx[idx])
                idx += 1
     len(halfed_idx) == 0 len(halfed_idx) len halfed_idx 0 prices[n] //= 2 prices[n] prices n 2 halfed_idx.append(n) halfed_idx.append halfed_idx append n n += 1 n 1 if prices[n] > prices[halfed_idx[idx]]:
                prices[n] //= 2
                halfed_idx.append(n)
                n += 1
            else:
                prices[halfed_idx[idx]] //= 2
                halfed_idx.append(halfed_idx[idx])
                idx += 1
     prices[n] > prices[halfed_idx[idx]] prices[n] prices n prices[halfed_idx[idx]] prices halfed_idx[idx] halfed_idx idx prices[n] //= 2 prices[n] prices n 2 halfed_idx.append(n) halfed_idx.append halfed_idx append n n += 1 n 1 prices[halfed_idx[idx]] //= 2 prices[halfed_idx[idx]] prices halfed_idx[idx] halfed_idx idx 2 halfed_idx.append(halfed_idx[idx]) halfed_idx.append halfed_idx append halfed_idx[idx] halfed_idx idx idx += 1 idx 1 print(sum(prices)) print sum(prices) sum prices N N M M As As def solve2(N, M, As):
    """later (ave 2.3 second)"""
    As.sort()
    for i in range(M):
        p = As.pop() // 2
        As.insert(bisect.bisect_right(As, p), p)
    print(sum(As)) solve2 """later (ave 2.3 second)""" As.sort() As.sort As sort for i in range(M):
        p = As.pop() // 2
        As.insert(bisect.bisect_right(As, p), p)
     i range(M) range M p = As.pop() // 2 p As.pop() // 2 As.pop() As.pop As pop 2 As.insert(bisect.bisect_right(As, p), p) As.insert As insert bisect.bisect_right(As, p) bisect.bisect_right bisect bisect_right As p p print(sum(As)) print sum(As) sum As N N M M As As if __name__ == '__main__':
    N, M = map(int, input().split())
    As = [int(i) for i in input().split()]

    # N, M = 10 ** 5, 10 ** 5
    # from random import randint
    # As = [randint(1, 10 ** 9) for _ in range(N)]
    solve(N, M, As)
    # solve2(N, M, As) __name__ == '__main__' __name__ '__main__' N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i As = [int(i) for i in input().split()] As [int(i) for i in input().split()] solve(N, M, As) solve N M As N, M = map(int, input().split()) map(int, input().split()) N M = map(int, input().split()) map(int, input().split()) M def solve(N, M, As):
    prices = sorted(As, reverse=True) + [0]
    halfed_idx = []
    n = 0
    idx = 0
    for _ in range(M):
        if len(halfed_idx) == 0:
            prices[n] //= 2
            halfed_idx.append(n)
            n += 1
        else:
            if prices[n] > prices[halfed_idx[idx]]:
                prices[n] //= 2
                halfed_idx.append(n)
                n += 1
            else:
                prices[halfed_idx[idx]] //= 2
                halfed_idx.append(halfed_idx[idx])
                idx += 1
    print(sum(prices)) def solve(N, M, As):
    prices = sorted(As, reverse=True) + [0]
    halfed_idx = []
    n = 0
    idx = 0
    for _ in range(M):
        if len(halfed_idx) == 0:
            prices[n] //= 2
            halfed_idx.append(n)
            n += 1
        else:
            if prices[n] > prices[halfed_idx[idx]]:
                prices[n] //= 2
                halfed_idx.append(n)
                n += 1
            else:
                prices[halfed_idx[idx]] //= 2
                halfed_idx.append(halfed_idx[idx])
                idx += 1
    print(sum(prices)) solve As = [int(i) for i in input().split()] [int(i) for i in input().split()] As def solve2(N, M, As):
    """later (ave 2.3 second)"""
    As.sort()
    for i in range(M):
        p = As.pop() // 2
        As.insert(bisect.bisect_right(As, p), p)
    print(sum(As)) def solve2(N, M, As):
    """later (ave 2.3 second)"""
    As.sort()
    for i in range(M):
        p = As.pop() // 2
        As.insert(bisect.bisect_right(As, p), p)
    print(sum(As)) solve2
# import sys
# sys.setrecursionlimit(10 ** 6)
import bisect
# from collections import deque
# from decorator import stop_watch
#
#
# @stop_watch
def solve(N, M, As):
    prices = sorted(As, reverse=True) + [0]
    halfed_idx = []
    n = 0
    idx = 0
    for _ in range(M):
        if len(halfed_idx) == 0:
            prices[n] //= 2
            halfed_idx.append(n)
            n += 1
        else:
            if prices[n] > prices[halfed_idx[idx]]:
                prices[n] //= 2
                halfed_idx.append(n)
                n += 1
            else:
                prices[halfed_idx[idx]] //= 2
                halfed_idx.append(halfed_idx[idx])
                idx += 1
    print(sum(prices))


def solve2(N, M, As):
    """later (ave 2.3 second)"""
    As.sort()
    for i in range(M):
        p = As.pop() // 2
        As.insert(bisect.bisect_right(As, p), p)
    print(sum(As))


if __name__ == '__main__':
    N, M = map(int, input().split())
    As = [int(i) for i in input().split()]

    # N, M = 10 ** 5, 10 ** 5
    # from random import randint
    # As = [randint(1, 10 ** 9) for _ in range(N)]
    solve(N, M, As)
    # solve2(N, M, As)
