import heapq

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def main():
    N, M = mi()
    A = list(map(lambda x: -int(x), input().split()))
    heapq.heapify(A)
    for i in range(M):
        t = heapq.heappop(A)
        heapq.heappush(A, -(-t//2))
    print(-sum(A))

if __name__ == '__main__':
    main() import heapq heapq def mi():
    return map(int, input().split()) mi return map(int, input().split()) map(int, input().split()) map int input().split() ().split () input split def ii():
    return int(input()) ii return int(input()) int(input()) int input() input def main():
    N, M = mi()
    A = list(map(lambda x: -int(x), input().split()))
    heapq.heapify(A)
    for i in range(M):
        t = heapq.heappop(A)
        heapq.heappush(A, -(-t//2))
    print(-sum(A)) main N, M = mi() N mi() mi M A = list(map(lambda x: -int(x), input().split())) A list(map(lambda x: -int(x), input().split())) list map(lambda x: -int(x), input().split()) map lambda x: -int(x) -int(x) int(x) int x x input().split() ().split () input split heapq.heapify(A) heapq.heapify heapq heapify A for i in range(M):
        t = heapq.heappop(A)
        heapq.heappush(A, -(-t//2))
     i range(M) range M t = heapq.heappop(A) t heapq.heappop(A) heapq.heappop heapq heappop A heapq.heappush(A, -(-t//2)) heapq.heappush heapq heappush A -(-t//2) -t//2 -t t 2 print(-sum(A)) print -sum(A) sum(A) sum A if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    N, M = mi()
    A = list(map(lambda x: -int(x), input().split()))
    heapq.heapify(A)
    for i in range(M):
        t = heapq.heappop(A)
        heapq.heappush(A, -(-t//2))
    print(-sum(A)) def main():
    N, M = mi()
    A = list(map(lambda x: -int(x), input().split()))
    heapq.heapify(A)
    for i in range(M):
        t = heapq.heappop(A)
        heapq.heappush(A, -(-t//2))
    print(-sum(A)) main def mi():
    return map(int, input().split()) def mi():
    return map(int, input().split()) mi def ii():
    return int(input()) def ii():
    return int(input()) ii
import heapq

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def main():
    N, M = mi()
    A = list(map(lambda x: -int(x), input().split()))
    heapq.heapify(A)
    for i in range(M):
        t = heapq.heappop(A)
        heapq.heappush(A, -(-t//2))
    print(-sum(A))

if __name__ == '__main__':
    main()
