# -*- coding: utf-8 -*-

import numpy as np

from collections import deque

import heapq

import collections

import itertools

import bisect

mod = 10 ** 9 + 7

N, M = list(map(int, input().split()))

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

A = list(np.array(A)*-1)

heap_tree = heapq.heapify(A)

for i in range(M):

    max_value = heapq.heappop(A)*-1

    max_value = (max_value//2)*-1

    heapq.heappush(A, max_value)

ans = 0

for a in A:

    ans -= a

print(ans)

# -*- coding: utf-8 -*-

import numpy as np

import sys

from collections import deque

from collections import defaultdict

import heapq

import collections

import itertools

import bisect

from scipy.special import comb

import copy

sys.setrecursionlimit(10**6)





def zz():

    return list(map(int, sys.stdin.readline().split()))





def z():

    return int(sys.stdin.readline())





def S():

    return sys.stdin.readline()[:-1]





def C(line):

    return [sys.stdin.readline() for _ in range(line)]





N, M = zz()

A = zz()

A = [-a for a in A]

heapq.heapify(A)



for i in range(M):

    money = heapq.heappop(A)

    money *= -1

    money //= 2

    money *= -1

    heapq.heappush(A, money)

print((sum(A)*-1))

# -*- coding: utf-8 -*-
import numpy as np
from collections import deque
import heapq
import collections
import itertools
import bisect

mod = 10**9 + 7
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
A = list(np.array(A) * -1)
heap_tree = heapq.heapify(A)
for i in range(M):
    max_value = heapq.heappop(A) * -1
    max_value = (max_value // 2) * -1
    heapq.heappush(A, max_value)
ans = 0
for a in A:
    ans -= a
print(ans)

# -*- coding: utf-8 -*-
import numpy as np
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect
from scipy.special import comb
import copy

sys.setrecursionlimit(10**6)


def zz():
    return list(map(int, sys.stdin.readline().split()))


def z():
    return int(sys.stdin.readline())


def S():
    return sys.stdin.readline()[:-1]


def C(line):
    return [sys.stdin.readline() for _ in range(line)]


N, M = zz()
A = zz()
A = [-a for a in A]
heapq.heapify(A)
for i in range(M):
    money = heapq.heappop(A)
    money *= -1
    money //= 2
    money *= -1
    heapq.heappush(A, money)
print((sum(A) * -1))

+import sys +from collections import defaultdict +from scipy.special import comb +import copy -mod = 10**9 + 7 -N, M = list(map(int, input().split())) -A = list(map(int, input().split())) -A = list(np.array(A) * -1) -heap_tree = heapq.heapify(A) +sys.setrecursionlimit(10**6) + + +def zz(): +    return list(map(int, sys.stdin.readline().split())) + + +def z(): +    return int(sys.stdin.readline()) + + +def S(): +    return sys.stdin.readline()[:-1] + + +def C(line): +    return [sys.stdin.readline() for _ in range(line)] + + +N, M = zz() +A = zz() +A = [-a for a in A] +heapq.heapify(A) -    max_value = heapq.heappop(A) * -1 -    max_value = (max_value // 2) * -1 -    heapq.heappush(A, max_value) -ans = 0 -for a in A: -    ans -= a -print(ans) +    money = heapq.heappop(A) +    money *= -1 +    money //= 2 +    money *= -1 +    heapq.heappush(A, money) +print((sum(A) * -1))