import queue


def m():
    N, M = map(int, input().split())
    q = queue.PriorityQueue()
    A = list(map(int, input().split()))
    ans = []
    for a in A:
        q.put(-a)
    while M > 0:
        x = -q.get()
        x = -(x >> 1)
        M -= 1
        q.put(x)
    while not q.empty(): ans.append(q.get())
    return abs(sum(ans))


print(m()) import queue queue def m():
    N, M = map(int, input().split())
    q = queue.PriorityQueue()
    A = list(map(int, input().split()))
    ans = []
    for a in A:
        q.put(-a)
    while M > 0:
        x = -q.get()
        x = -(x >> 1)
        M -= 1
        q.put(x)
    while not q.empty(): ans.append(q.get())
    return abs(sum(ans)) m N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M q = queue.PriorityQueue() q queue.PriorityQueue() queue.PriorityQueue queue PriorityQueue A = list(map(int, input().split())) A list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split ans = [] ans [] for a in A:
        q.put(-a)
     a A q.put(-a) q.put q put -a a while M > 0:
        x = -q.get()
        x = -(x >> 1)
        M -= 1
        q.put(x)
     M > 0 M 0 x = -q.get() x -q.get() q.get() q.get q get x = -(x >> 1) x -(x >> 1) x >> 1 x 1 M -= 1 M 1 q.put(x) q.put q put x while not q.empty(): ans.append(q.get())
     not q.empty() q.empty() q.empty q empty return abs(sum(ans)) abs(sum(ans)) abs sum(ans) sum ans print(m()) print m() m def m():
    N, M = map(int, input().split())
    q = queue.PriorityQueue()
    A = list(map(int, input().split()))
    ans = []
    for a in A:
        q.put(-a)
    while M > 0:
        x = -q.get()
        x = -(x >> 1)
        M -= 1
        q.put(x)
    while not q.empty(): ans.append(q.get())
    return abs(sum(ans)) def m():
    N, M = map(int, input().split())
    q = queue.PriorityQueue()
    A = list(map(int, input().split()))
    ans = []
    for a in A:
        q.put(-a)
    while M > 0:
        x = -q.get()
        x = -(x >> 1)
        M -= 1
        q.put(x)
    while not q.empty(): ans.append(q.get())
    return abs(sum(ans)) m
import queue


def m():
    N, M = map(int, input().split())
    q = queue.PriorityQueue()
    A = list(map(int, input().split()))
    ans = []
    for a in A:
        q.put(-a)
    while M > 0:
        x = -q.get()
        x = -(x >> 1)
        M -= 1
        q.put(x)
    while not q.empty(): ans.append(q.get())
    return abs(sum(ans))


print(m())
