def main():
    import heapq
    n,m = map(int,input().split())
    a = list(map(int,input().split()))
    A = []
    for i in range(n):
        heapq.heappush(A,-1*a[i])
    for i in range(m):
        a = heapq.heappop(A)
        a = (-1*a)//2
        heapq.heappush(A,-1*a)
    print(-1*sum(A))

if __name__ == "__main__":
    main() def main():
    import heapq
    n,m = map(int,input().split())
    a = list(map(int,input().split()))
    A = []
    for i in range(n):
        heapq.heappush(A,-1*a[i])
    for i in range(m):
        a = heapq.heappop(A)
        a = (-1*a)//2
        heapq.heappush(A,-1*a)
    print(-1*sum(A)) main import heapq heapq n,m = map(int,input().split()) n 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 = [] A [] for i in range(n):
        heapq.heappush(A,-1*a[i])
     i range(n) range n heapq.heappush(A,-1*a[i]) heapq.heappush heapq heappush A -1*a[i] -1 a[i] a i for i in range(m):
        a = heapq.heappop(A)
        a = (-1*a)//2
        heapq.heappush(A,-1*a)
     i range(m) range m a = heapq.heappop(A) a heapq.heappop(A) heapq.heappop heapq heappop A a = (-1*a)//2 a (-1*a)//2 -1*a -1 a 2 heapq.heappush(A,-1*a) heapq.heappush heapq heappush A -1*a -1 a print(-1*sum(A)) print -1*sum(A) -1 sum(A) sum A if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    import heapq
    n,m = map(int,input().split())
    a = list(map(int,input().split()))
    A = []
    for i in range(n):
        heapq.heappush(A,-1*a[i])
    for i in range(m):
        a = heapq.heappop(A)
        a = (-1*a)//2
        heapq.heappush(A,-1*a)
    print(-1*sum(A)) def main():
    import heapq
    n,m = map(int,input().split())
    a = list(map(int,input().split()))
    A = []
    for i in range(n):
        heapq.heappush(A,-1*a[i])
    for i in range(m):
        a = heapq.heappop(A)
        a = (-1*a)//2
        heapq.heappush(A,-1*a)
    print(-1*sum(A)) main
def main():
    import heapq
    n,m = map(int,input().split())
    a = list(map(int,input().split()))
    A = []
    for i in range(n):
        heapq.heappush(A,-1*a[i])
    for i in range(m):
        a = heapq.heappop(A)
        a = (-1*a)//2
        heapq.heappush(A,-1*a)
    print(-1*sum(A))

if __name__ == "__main__":
    main()
