using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder
{
    class ABC141
    {
        static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }

        static long[] ReadLongs()
        {
            return Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
        }

        static double ReadDouble()
        {
            return double.Parse(Console.ReadLine());
        }

        static double[] ReadDoubles()
        {
            return Console.ReadLine().Split(' ').Select(double.Parse).ToArray();
        }

        static string ReadString()
        {
            return Console.ReadLine();
        }

        static string[] ReadStringSplit()
        {
            return Console.ReadLine().Split(' ');
        }

        static void A()
        {
            var s = ReadString();
            switch (s)
            {
                case "Sunny":
                    Console.WriteLine("Cloudy");
                    break;
                case "Cloudy":
                    Console.WriteLine("Rainy");
                    break;
                case "Rainy":
                    Console.WriteLine("Sunny");
                    break;
            }
        }

        static void B()
        {
            var S = ReadString();
            for (int i = 0; i < S.Length; ++i)
            {
                if (i % 2 == 0)
                {
                    if (S[i] == 'L')
                    {
                        Console.WriteLine("No");
                        return;
                    }
                }
                else
                {
                    if (S[i] == 'R')
                    {
                        Console.WriteLine("No");
                        return;
                    }

                }
            }
            Console.WriteLine("Yes");
        }

        static void C()
        {
            var longsInput = ReadLongs();
            var N = longsInput[0];
            var K = longsInput[1];
            var Q = longsInput[2];
            var AnsCounts = Enumerable.Range(0, (int)N)
                                        .Select(x => 0)
                                        .ToArray();
            for (int i = 0; i < Q; ++i)
            {
                var l = ReadLong();
                AnsCounts[l - 1]++;
            }
            for (int i = 0; i < N; ++i)
            {
                if (K - (Q - AnsCounts[i]) > 0)
                {
                    Console.WriteLine("Yes");
                }
                else
                {
                    Console.WriteLine("No");
                }
            }
        }

        static void D()
        {
            var NM = ReadLongs();
            var N = NM[0];
            var M = NM[1];
            var As = ReadLongs();

            var pq = new PriorityQueue();
            foreach (var value in As)
            {
                pq.push(-value);
            }
            
            foreach (var itr in Enumerable.Range(0, (int)M))
            {
                var value = pq.pop();
                pq.push(value / 2);
            }

            Console.WriteLine(-pq.sum());
        }

        static void Main(string[] args)
        {
            //A();
            //B();
            //C();
            D();
        }
    }

    class PriorityQueue
    {
        public PriorityQueue ()
        {
            _heap = new long[100010];
            size = 0;
        }

        public void push(long x)
        {
            var i = size;
            size++;
            while (i > 0)
            {
                var p = (i - 1) / 2;

                if (_heap[p] <= x)
                {
                    break;
                }
                _heap[i] = _heap[p];
                i = p;
            }

            _heap[i] = x;
        }

        public long pop()
        {
            var ret = _heap[0];
            size--;
            var x = _heap[size];
            int i = 0;
            while ((i * 2) + 1 < size)
            {
                var a = (i * 2) + 1;
                var b = (i * 2) + 2;
                if (b < size && _heap[b] < _heap[a])
                {
                    a = b;
                }
                if (_heap[a] >= x)
                {
                    break;
                }
                _heap[i] = _heap[a];
                i = a;
            }

            _heap[i] = x;
            return ret;
        }

        public long sum()
        {
            long ret = 0;
            foreach (var index in Enumerable.Range(0, size))
            {
                ret += _heap[index];
            }
            return ret;
        }

        public void show()
        {
            Console.Write("show: ");
            foreach (var index in Enumerable.Range(0, size))
            {
                Console.Write(_heap[index] + ", ");
            }
            Console.WriteLine();
        }

        long[] _heap;
        int size;
    }
}


Measured memory_bytes: 39492