using System;
using System.Collections.Generic;

namespace abc141_d
{
  class Program
  {
    static void Main(string[] args)
    {
      var n = CIn.ReadInt();
      var m = CIn.ReadInt();
      var pq = new PriorityQueue<int>();

      for (var i = 0; i < n; i++)
      {
        pq.Enqueue(CIn.ReadInt());
      }

      for (var i = 0; i < m; i++)
      {
        var a = pq.Dequeue();

        if (a == 0)
        {
          Console.WriteLine(0);
          return;
        }

        a /= 2;
        pq.Enqueue(a);
      }

      var ans = 0L;

      for (var i = 0; i < n; i++)
      {
        ans += pq.Dequeue();
      }

      Console.WriteLine(ans);
    }
  }

  class PriorityQueue<T> where T : IComparable<T>
  {
    private readonly List<T> heap = new List<T>();
    private readonly int order;

    public int Count
    {
      get
      {
        return heap.Count;
      }
    }

    public PriorityQueue(bool ascOrder = false)
    {
      order = ascOrder ? -1 : 1;
    }

    public void Enqueue(T element)
    {
      var n = heap.Count;
      heap.Add(element);

      while (n != 0)
      {
        var i = (n - 1) / 2;

        if (heap[n].CompareTo(heap[i]) * order > 0)
        {
          var tmp = heap[n];
          heap[n] = heap[i];
          heap[i] = tmp;
        }

        n = i;
      }
    }

    public T Dequeue()
    {
      if (heap.Count == 0)
      {
        throw new InvalidOperationException("PriorityQueue is Empty");
      }

      var n = heap.Count - 1;
      var element = heap[0];
      heap[0] = heap[n];
      heap.RemoveAt(n);

      var i = 0;
      var j = 2 * i + 1;

      while (j < n)
      {
        if (j != n - 1 && heap[j].CompareTo(heap[j + 1]) * order < 0)
        {
          j++;
        }

        if (heap[i].CompareTo(heap[j]) * order < 0)
        {
          var tmp = heap[i];
          heap[i] = heap[j];
          heap[j] = tmp;
        }

        i = j;
        j = 2 * i + 1;
      }

      return element;
    }

    public T Peek()
    {
      if (heap.Count == 0)
      {
        throw new InvalidOperationException("PriorityQueue is Empty");
      }

      return heap[0];
    }
  }

  class CIn
  {
    private static readonly Queue<string> fieldBuffer = new Queue<string>();

    public static string Read()
    {
      if (fieldBuffer.Count == 0)
      {
        foreach (var field in Console.ReadLine().Split())
        {
          fieldBuffer.Enqueue(field);
        }
      }

      return fieldBuffer.Dequeue();
    }

    public static int ReadInt() => int.Parse(Read());
    public static long ReadLong() => long.Parse(Read());
    public static double ReadDouble() => double.Parse(Read());

    public static string[] ReadStringArray(long n)
    {
      var array = new string[n];

      for (var i = 0; i < n; i++)
      {
        array[i] = Read();
      }

      return array;
    }

    public static int[] ReadIntArray(long n)
    {
      var array = new int[n];

      for (var i = 0; i < n; i++)
      {
        array[i] = ReadInt();
      }

      return array;
    }

    public static long[] ReadLongArray(long n)
    {
      var array = new long[n];

      for (var i = 0; i < n; i++)
      {
        array[i] = ReadLong();
      }

      return array;
    }
    public static double[] ReadDoubleArray(long n)
    {
      var array = new double[n];

      for (var i = 0; i < n; i++)
      {
        array[i] = ReadDouble();
      }

      return array;
    }
  }
}


Measured memory_bytes: 31836