import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    import heapq
    mod=10**9+7
    N,M=MI()
    A=LI()
    for i in range(N):
        A[i]*=-1
    heapq.heapify(A)
    
    for i in range(M):
        a=heapq.heappop(A)
        heapq.heappush(A,a/2)
        
    ans=0
    for i in range(N):
        a=heapq.heappop(A) * -1
        ans+=int(a)
        
    print(ans)
        

main() import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline def I(): return int(input()) I def MI(): return map(int, input().split()) MI def LI(): return list(map(int, input().split())) LI def main():
    import heapq
    mod=10**9+7
    N,M=MI()
    A=LI()
    for i in range(N):
        A[i]*=-1
    heapq.heapify(A)
    
    for i in range(M):
        a=heapq.heappop(A)
        heapq.heappush(A,a/2)
        
    ans=0
    for i in range(N):
        a=heapq.heappop(A) * -1
        ans+=int(a)
        
    print(ans)
         main import heapq heapq mod=10**9+7 mod 10**9+7 10**9 10 9 7 N,M=MI() N MI() MI M A=LI() A LI() LI for i in range(N):
        A[i]*=-1
     i range(N) range N A[i]*=-1 A[i] A i -1 heapq.heapify(A) heapq.heapify heapq heapify A for i in range(M):
        a=heapq.heappop(A)
        heapq.heappush(A,a/2)
        
     i range(M) range M a=heapq.heappop(A) a heapq.heappop(A) heapq.heappop heapq heappop A heapq.heappush(A,a/2) heapq.heappush heapq heappush A a/2 a 2 ans=0 ans 0 for i in range(N):
        a=heapq.heappop(A) * -1
        ans+=int(a)
        
     i range(N) range N a=heapq.heappop(A) * -1 a heapq.heappop(A) * -1 heapq.heappop(A) heapq.heappop heapq heappop A -1 ans+=int(a) ans int(a) int a print(ans) print ans main() main input = sys.stdin.readline sys.stdin.readline input def main():
    import heapq
    mod=10**9+7
    N,M=MI()
    A=LI()
    for i in range(N):
        A[i]*=-1
    heapq.heapify(A)
    
    for i in range(M):
        a=heapq.heappop(A)
        heapq.heappush(A,a/2)
        
    ans=0
    for i in range(N):
        a=heapq.heappop(A) * -1
        ans+=int(a)
        
    print(ans)
         def main():
    import heapq
    mod=10**9+7
    N,M=MI()
    A=LI()
    for i in range(N):
        A[i]*=-1
    heapq.heapify(A)
    
    for i in range(M):
        a=heapq.heappop(A)
        heapq.heappush(A,a/2)
        
    ans=0
    for i in range(N):
        a=heapq.heappop(A) * -1
        ans+=int(a)
        
    print(ans)
         main def I(): return int(input()) def I(): return int(input()) I def MI(): return map(int, input().split()) def MI(): return map(int, input().split()) MI def LI(): return list(map(int, input().split())) def LI(): return list(map(int, input().split())) LI
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    import heapq
    mod=10**9+7
    N,M=MI()
    A=LI()
    for i in range(N):
        A[i]*=-1
    heapq.heapify(A)
    
    for i in range(M):
        a=heapq.heappop(A)
        heapq.heappush(A,a/2)
        
    ans=0
    for i in range(N):
        a=heapq.heappop(A) * -1
        ans+=int(a)
        
    print(ans)
        

main()
