from collections import defaultdict
from collections import deque
from collections import OrderedDict
import itertools
import heapq
from sys import stdin
input = stdin.readline


class MaxHeapObj(object):
  def __init__(self, val):
    self.val = val

  def __lt__(self, other):
    return self.val > other.val

  def __eq__(self, other):
    return self.val == other.val

  def __str__(self):
    return str(self.val)


class MinHeap(object):
  def __init__(self, L=None):
    if L is None:
      self.h = []
    else:
      heapq.heapify(L)
      self.h = L

  def heappush(self, x):
    heapq.heappush(self.h, x)

  def heappop(self):
    return heapq.heappop(self.h)

  def __getitem__(self, i):
    return self.h[i]

  def __len__(self):
    return len(self.h)


class MaxHeap(MinHeap):
  def __init__(self, L=None):
    super(MaxHeap, self).__init__(list(map(lambda x: MaxHeapObj(x), L)))

  def heappush(self, x):
    heapq.heappush(self.h, MaxHeapObj(x))

  def heappop(self):
    return heapq.heappop(self.h).val

  def __getitem__(self, i):
    return self.h[i].val


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

  PQ = MaxHeap(A)

  while M:
    now = PQ.heappop()
    PQ.heappush(int(now/2))
    M -= 1

  sum_ = 0
  for x in PQ.h:
    sum_ += x.val
  print(sum_)


if(__name__ == '__main__'):
  main() from collections import defaultdict from collections import deque from collections import OrderedDict import itertools itertools import heapq heapq from sys import stdin input = stdin.readline input stdin.readline stdin readline class MaxHeapObj(object):
  def __init__(self, val):
    self.val = val

  def __lt__(self, other):
    return self.val > other.val

  def __eq__(self, other):
    return self.val == other.val

  def __str__(self):
    return str(self.val) MaxHeapObj def __init__(self, val):
    self.val = val

   __init__ self.val = val self.val self val val self self val val def __lt__(self, other):
    return self.val > other.val

   __lt__ return self.val > other.val self.val > other.val self.val self val other.val other val self self other other def __eq__(self, other):
    return self.val == other.val

   __eq__ return self.val == other.val self.val == other.val self.val self val other.val other val self self other other def __str__(self):
    return str(self.val) __str__ return str(self.val) str(self.val) str self.val self val self self object class MinHeap(object):
  def __init__(self, L=None):
    if L is None:
      self.h = []
    else:
      heapq.heapify(L)
      self.h = L

  def heappush(self, x):
    heapq.heappush(self.h, x)

  def heappop(self):
    return heapq.heappop(self.h)

  def __getitem__(self, i):
    return self.h[i]

  def __len__(self):
    return len(self.h) MinHeap def __init__(self, L=None):
    if L is None:
      self.h = []
    else:
      heapq.heapify(L)
      self.h = L

   __init__ if L is None:
      self.h = []
    else:
      heapq.heapify(L)
      self.h = L

   L is None L None self.h = [] self.h self h [] heapq.heapify(L) heapq.heapify heapq heapify L self.h = L self.h self h L self self L=None L None def heappush(self, x):
    heapq.heappush(self.h, x)

   heappush heapq.heappush(self.h, x) heapq.heappush heapq heappush self.h self h x self self x x def heappop(self):
    return heapq.heappop(self.h)

   heappop return heapq.heappop(self.h) heapq.heappop(self.h) heapq.heappop heapq heappop self.h self h self self def __getitem__(self, i):
    return self.h[i]

   __getitem__ return self.h[i] self.h[i] self.h self h i self self i i def __len__(self):
    return len(self.h) __len__ return len(self.h) len(self.h) len self.h self h self self object class MaxHeap(MinHeap):
  def __init__(self, L=None):
    super(MaxHeap, self).__init__(list(map(lambda x: MaxHeapObj(x), L)))

  def heappush(self, x):
    heapq.heappush(self.h, MaxHeapObj(x))

  def heappop(self):
    return heapq.heappop(self.h).val

  def __getitem__(self, i):
    return self.h[i].val MaxHeap def __init__(self, L=None):
    super(MaxHeap, self).__init__(list(map(lambda x: MaxHeapObj(x), L)))

   __init__ super(MaxHeap, self).__init__(list(map(lambda x: MaxHeapObj(x), L))) (MaxHeap, self).__init__ (MaxHeap, self) super MaxHeap self __init__ list(map(lambda x: MaxHeapObj(x), L)) list map(lambda x: MaxHeapObj(x), L) map lambda x: MaxHeapObj(x) MaxHeapObj(x) MaxHeapObj x x L self self L=None L None def heappush(self, x):
    heapq.heappush(self.h, MaxHeapObj(x))

   heappush heapq.heappush(self.h, MaxHeapObj(x)) heapq.heappush heapq heappush self.h self h MaxHeapObj(x) MaxHeapObj x self self x x def heappop(self):
    return heapq.heappop(self.h).val

   heappop return heapq.heappop(self.h).val heapq.heappop(self.h).val heapq.heappop(self.h) heapq.heappop heapq heappop self.h self h val self self def __getitem__(self, i):
    return self.h[i].val __getitem__ return self.h[i].val self.h[i].val self.h[i] self.h self h i val self self i i MinHeap def main():
  N, M = list(map(int, input().split()))
  A = list(map(int, input().split()))

  PQ = MaxHeap(A)

  while M:
    now = PQ.heappop()
    PQ.heappush(int(now/2))
    M -= 1

  sum_ = 0
  for x in PQ.h:
    sum_ += x.val
  print(sum_) main 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 PQ = MaxHeap(A) PQ MaxHeap(A) MaxHeap A while M:
    now = PQ.heappop()
    PQ.heappush(int(now/2))
    M -= 1

   M now = PQ.heappop() now PQ.heappop() PQ.heappop PQ heappop PQ.heappush(int(now/2)) PQ.heappush PQ heappush int(now/2) int now/2 now 2 M -= 1 M 1 sum_ = 0 sum_ 0 for x in PQ.h:
    sum_ += x.val
   x PQ.h PQ h sum_ += x.val sum_ x.val x val print(sum_) print sum_ if(__name__ == '__main__'):
  main() __name__ == '__main__' __name__ '__main__' main() main input = stdin.readline stdin.readline input def main():
  N, M = list(map(int, input().split()))
  A = list(map(int, input().split()))

  PQ = MaxHeap(A)

  while M:
    now = PQ.heappop()
    PQ.heappush(int(now/2))
    M -= 1

  sum_ = 0
  for x in PQ.h:
    sum_ += x.val
  print(sum_) def main():
  N, M = list(map(int, input().split()))
  A = list(map(int, input().split()))

  PQ = MaxHeap(A)

  while M:
    now = PQ.heappop()
    PQ.heappush(int(now/2))
    M -= 1

  sum_ = 0
  for x in PQ.h:
    sum_ += x.val
  print(sum_) main class MaxHeapObj(object):
  def __init__(self, val):
    self.val = val

  def __lt__(self, other):
    return self.val > other.val

  def __eq__(self, other):
    return self.val == other.val

  def __str__(self):
    return str(self.val) class MaxHeapObj(object):
  def __init__(self, val):
    self.val = val

  def __lt__(self, other):
    return self.val > other.val

  def __eq__(self, other):
    return self.val == other.val

  def __str__(self):
    return str(self.val) MaxHeapObj class MaxHeap(MinHeap):
  def __init__(self, L=None):
    super(MaxHeap, self).__init__(list(map(lambda x: MaxHeapObj(x), L)))

  def heappush(self, x):
    heapq.heappush(self.h, MaxHeapObj(x))

  def heappop(self):
    return heapq.heappop(self.h).val

  def __getitem__(self, i):
    return self.h[i].val class MaxHeap(MinHeap):
  def __init__(self, L=None):
    super(MaxHeap, self).__init__(list(map(lambda x: MaxHeapObj(x), L)))

  def heappush(self, x):
    heapq.heappush(self.h, MaxHeapObj(x))

  def heappop(self):
    return heapq.heappop(self.h).val

  def __getitem__(self, i):
    return self.h[i].val MaxHeap class MinHeap(object):
  def __init__(self, L=None):
    if L is None:
      self.h = []
    else:
      heapq.heapify(L)
      self.h = L

  def heappush(self, x):
    heapq.heappush(self.h, x)

  def heappop(self):
    return heapq.heappop(self.h)

  def __getitem__(self, i):
    return self.h[i]

  def __len__(self):
    return len(self.h) class MinHeap(object):
  def __init__(self, L=None):
    if L is None:
      self.h = []
    else:
      heapq.heapify(L)
      self.h = L

  def heappush(self, x):
    heapq.heappush(self.h, x)

  def heappop(self):
    return heapq.heappop(self.h)

  def __getitem__(self, i):
    return self.h[i]

  def __len__(self):
    return len(self.h) MinHeap
from collections import defaultdict
from collections import deque
from collections import OrderedDict
import itertools
import heapq
from sys import stdin
input = stdin.readline


class MaxHeapObj(object):
  def __init__(self, val):
    self.val = val

  def __lt__(self, other):
    return self.val > other.val

  def __eq__(self, other):
    return self.val == other.val

  def __str__(self):
    return str(self.val)


class MinHeap(object):
  def __init__(self, L=None):
    if L is None:
      self.h = []
    else:
      heapq.heapify(L)
      self.h = L

  def heappush(self, x):
    heapq.heappush(self.h, x)

  def heappop(self):
    return heapq.heappop(self.h)

  def __getitem__(self, i):
    return self.h[i]

  def __len__(self):
    return len(self.h)


class MaxHeap(MinHeap):
  def __init__(self, L=None):
    super(MaxHeap, self).__init__(list(map(lambda x: MaxHeapObj(x), L)))

  def heappush(self, x):
    heapq.heappush(self.h, MaxHeapObj(x))

  def heappop(self):
    return heapq.heappop(self.h).val

  def __getitem__(self, i):
    return self.h[i].val


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

  PQ = MaxHeap(A)

  while M:
    now = PQ.heappop()
    PQ.heappush(int(now/2))
    M -= 1

  sum_ = 0
  for x in PQ.h:
    sum_ += x.val
  print(sum_)


if(__name__ == '__main__'):
  main()
