using System;
using System.Linq;
using System.Collections.Generic;

namespace D
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] nm = Console.ReadLine().Split().Select(int.Parse).ToArray();

            int n = nm[0];
            int m = nm[1];

            Heap pq = new Heap(Console.ReadLine().Split().Select(long.Parse).ToList());


            while (m > 0)
            {
                long B = pq.Pop();
                B = (int)B >>1;
                pq.Push(B);
                // pq.Push((int)pq.Pop() >> 1);
                m--;
            }

            long sum = 0;
            while (pq.q.Count() > 0)
            {
                sum += (long)pq.Pop();
            }

            Console.WriteLine(sum);

        }

        public class Heap
        {
            public List<long> q;

            public Heap(List<long> Array)
            {
                q = new List<long>();
                foreach (var x in Array) this.Push(x);
            }

            public void Push(long elem)
            {
                int n = q.Count();
                q.Add(elem);

                while (n != 0)
                {
                    //親
                    int i = (n - 1) / 2;
                    if (q[n] > q[i])
                    {
                        var tmp = q[n];
                        q[n] = q[i];
                        q[i] = tmp;
                    }
                    n = i;
                }
            }

            public long Pop()
            {
                long ret = q.First();
                q[0] = q.Last();
                q.RemoveAt(q.Count() - 1);


                for (int index = 0; q.Count() > 1&&index * 2 < q.Count();)
                {
                    if ((index * 2 + 2) >= q.Count())
                    {
                        if (index * 2 + 2 > q.Count())
                        {
                            break;
                        }
                        if (q[index * 2 + 1] > q[index])
                        {
                            long tmp = q[index];
                            q[index] = q[index * 2 + 1];
                            q[index * 2 + 1] = tmp;
                            break;
                        }
                        else
                        {
                            break;
                        }
                    }
                    else
                    {
                        if (q[index] == q[index * 2 + 1] && q[index] == q[index * 2 + 2])
                        {
                            break;
                        }
                        else
                        {
                            int A = q[index * 2 + 1] > q[index * 2 + 2] ? index * 2 + 1 : index * 2 + 2;
                            if (q[index] < q[A])
                            {
                                long tmp = q[index];
                                q[index] = q[A];
                                q[A] = tmp;
                                index = A;
                            }
                            else
                            {
                                break;
                            }
                        }
                    }
                }
                return ret;
            }
        }
    }
}


Measured memory_bytes: 31836