from collections import deque

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

A = deque(sorted(A,reverse=True))
B = deque([])
n = 0
for m in range(M):
    if A:
        if B:
            if (A[0] > B[0]):
                B.append(A.popleft()//2)
                continue
        else:
            B.append(A.popleft()//2)
            continue
    # print(m,n)
    n += 1
    b = B.popleft()
    B.append(b//2)

print(sum(A)+sum(B)) from collections import deque N,M = list(map(int,input().split())) N list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split M A = list(map(int,input().split())) A list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split A = deque(sorted(A,reverse=True)) A deque(sorted(A,reverse=True)) deque sorted(A,reverse=True) sorted A reverse=True reverse True B = deque([]) B deque([]) deque [] n = 0 n 0 for m in range(M):
    if A:
        if B:
            if (A[0] > B[0]):
                B.append(A.popleft()//2)
                continue
        else:
            B.append(A.popleft()//2)
            continue
    # print(m,n)
    n += 1
    b = B.popleft()
    B.append(b//2) m range(M) range M if A:
        if B:
            if (A[0] > B[0]):
                B.append(A.popleft()//2)
                continue
        else:
            B.append(A.popleft()//2)
            continue
    # print(m,n)
     A if B:
            if (A[0] > B[0]):
                B.append(A.popleft()//2)
                continue
        else:
            B.append(A.popleft()//2)
            continue
    # print(m,n)
     B if (A[0] > B[0]):
                B.append(A.popleft()//2)
                continue
         A[0] > B[0] A[0] A 0 B[0] B 0 B.append(A.popleft()//2) B.append B append A.popleft()//2 A.popleft() A.popleft A popleft 2 continue B.append(A.popleft()//2) B.append B append A.popleft()//2 A.popleft() A.popleft A popleft 2 continue n += 1 n 1 b = B.popleft() b B.popleft() B.popleft B popleft B.append(b//2) B.append B append b//2 b 2 print(sum(A)+sum(B)) print sum(A)+sum(B) sum(A) sum A sum(B) sum B N,M = list(map(int,input().split())) list(map(int,input().split())) N A = deque(sorted(A,reverse=True)) deque(sorted(A,reverse=True)) A M = list(map(int,input().split())) list(map(int,input().split())) M b = B.popleft() B.popleft() b A = list(map(int,input().split())) list(map(int,input().split())) A n = 0 0 n n += 1 1 n B = deque([]) deque([]) B
from collections import deque

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

A = deque(sorted(A,reverse=True))
B = deque([])
n = 0
for m in range(M):
    if A:
        if B:
            if (A[0] > B[0]):
                B.append(A.popleft()//2)
                continue
        else:
            B.append(A.popleft()//2)
            continue
    # print(m,n)
    n += 1
    b = B.popleft()
    B.append(b//2)

print(sum(A)+sum(B))