'''
Created on 2020/09/09

@author: harurun
'''
def main():
  import heapq
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  N,M=map(int,pin().split())
  A=list(map(int,pin().split()))
  B=list(map(lambda x: -x ,A))
  heapq.heapify(B)
  for i in range(M):
    t=heapq.heappop(B)
    s=-((-t)//2)
    heapq.heappush(B,s)
  ans=0
  for j in range(N):
    q=heapq.heappop(B)
    ans+=(-q)
  print(ans)
  return
main() '''
Created on 2020/09/09

@author: harurun
''' def main():
  import heapq
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  N,M=map(int,pin().split())
  A=list(map(int,pin().split()))
  B=list(map(lambda x: -x ,A))
  heapq.heapify(B)
  for i in range(M):
    t=heapq.heappop(B)
    s=-((-t)//2)
    heapq.heappush(B,s)
  ans=0
  for j in range(N):
    q=heapq.heappop(B)
    ans+=(-q)
  print(ans)
  return main import heapq heapq import sys sys pin=sys.stdin.readline pin sys.stdin.readline sys.stdin sys stdin readline pout=sys.stdout.write pout sys.stdout.write sys.stdout sys stdout write perr=sys.stderr.write perr sys.stderr.write sys.stderr sys stderr write N,M=map(int,pin().split()) N map(int,pin().split()) map int pin().split() ().split () pin split M A=list(map(int,pin().split())) A list(map(int,pin().split())) list map(int,pin().split()) map int pin().split() ().split () pin split B=list(map(lambda x: -x ,A)) B list(map(lambda x: -x ,A)) list map(lambda x: -x ,A) map lambda x: -x -x x x A heapq.heapify(B) heapq.heapify heapq heapify B for i in range(M):
    t=heapq.heappop(B)
    s=-((-t)//2)
    heapq.heappush(B,s)
   i range(M) range M t=heapq.heappop(B) t heapq.heappop(B) heapq.heappop heapq heappop B s=-((-t)//2) s -((-t)//2) (-t)//2 -t t 2 heapq.heappush(B,s) heapq.heappush heapq heappush B s ans=0 ans 0 for j in range(N):
    q=heapq.heappop(B)
    ans+=(-q)
   j range(N) range N q=heapq.heappop(B) q heapq.heappop(B) heapq.heappop heapq heappop B ans+=(-q) ans -q q print(ans) print ans return main() main def main():
  import heapq
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  N,M=map(int,pin().split())
  A=list(map(int,pin().split()))
  B=list(map(lambda x: -x ,A))
  heapq.heapify(B)
  for i in range(M):
    t=heapq.heappop(B)
    s=-((-t)//2)
    heapq.heappush(B,s)
  ans=0
  for j in range(N):
    q=heapq.heappop(B)
    ans+=(-q)
  print(ans)
  return def main():
  import heapq
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  N,M=map(int,pin().split())
  A=list(map(int,pin().split()))
  B=list(map(lambda x: -x ,A))
  heapq.heapify(B)
  for i in range(M):
    t=heapq.heappop(B)
    s=-((-t)//2)
    heapq.heappush(B,s)
  ans=0
  for j in range(N):
    q=heapq.heappop(B)
    ans+=(-q)
  print(ans)
  return main
'''
Created on 2020/09/09

@author: harurun
'''
def main():
  import heapq
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  N,M=map(int,pin().split())
  A=list(map(int,pin().split()))
  B=list(map(lambda x: -x ,A))
  heapq.heapify(B)
  for i in range(M):
    t=heapq.heappop(B)
    s=-((-t)//2)
    heapq.heappush(B,s)
  ans=0
  for j in range(N):
    q=heapq.heappop(B)
    ans+=(-q)
  print(ans)
  return
main()