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

namespace PAST0
{
    using static Ex;
    public class Solve
    {
        public static void Main(string[] args)
        {
            new PAST_H();
        }
    }
    public class PAST_H
    {
        long n, m;
        public PAST_H()
        {
            var l0 = ReadLongArray();
            n = l0[0];
            m = l0[1];
            var l = ReadLongArray();

            var pq = new PriorityQueue<long>();

            long ans = 0;
            foreach (var v in l)
            {
                pq.Push(v);
                ans += v;
            }

            while (m > 0)
            {
                var d = pq.Pop();
                var i = (int)Math.Floor(d / 2.0);
                pq.Push(i);
                ans -= d - i;
                m--;
            }

            ans.Cw();
        }
    }
    public class PAST_I
    {
        public PAST_I()
        {
        }
    }
    public class PAST_J
    {
        public PAST_J()
        {
        }
    }
    public static class Ex
    {
        public static void Cw(this object s) { Console.WriteLine(s); }



        public static bool Mins<T>(ref T a, T b) where T : IComparable<T> { if (a.CompareTo(b) > 0) { a = b; return true; } return false; }
        public static bool Maxs<T>(ref T a, T b) where T : IComparable<T> { if (a.CompareTo(b) < 0) { a = b; return true; } return false; }
        public static void Swap<T>(ref T a, ref T b) { var t = b; b = a; a = t; }


        static long Gcd(long m, long n) { if (n == 0) return m; return Gcd(n, m % n); }
        public static List<string> FastSort(this List<string> s) { s.Sort(StringComparer.Ordinal); return s.ToList(); }
        public static void yesno(this bool b) { (b ? "yes" : "no").Cw(); }
        public static void YesNo(this bool b) { (b ? "Yes" : "No").Cw(); }
        public static void YESNO(this bool b) { (b ? "YES" : "NO").Cw(); }

        public static string Read { get { return Console.ReadLine().Trim(); } }
        public static int ReadInt { get { return int.Parse(Read); } }
        public static long ReadLong { get { return long.Parse(Read); } }
        public static double ReadDouble { get { return double.Parse(Read); } }
        public static string[] ReadArray() { return Read.Split(' '); }
        public static int[] ReadIntArray() { return Read.Split(' ').Select(int.Parse).ToArray(); }
        public static long[] ReadLongArray() { return Read.Split(' ').Select(long.Parse).ToArray(); }
        public static string[] ReadArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret; }
        public static int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
        public static long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }


        public class PriorityQueue<T>
          where T : IComparable<T>
        {
            List<T> buffer;
            public PriorityQueue() { this.buffer = new List<T>(); }
            public PriorityQueue(int capacity) { this.buffer = new List<T>(capacity); }
            static void PushHeap(List<T> array, T elem)
            {
                int n = array.Count;
                array.Add(elem);

                while (n != 0)
                {
                    int i = (n - 1) / 2;
                    if (array[n].CompareTo(array[i]) > 0)
                    {
                        T tmp = array[n]; array[n] = array[i]; array[i] = tmp;
                    }
                    n = i;
                }
            }
            static void PopHeap(List<T> array)
            {
                int n = array.Count - 1;
                array[0] = array[n];
                array.RemoveAt(n);

                for (int i = 0, j; (j = 2 * i + 1) < n;)
                {
                    if ((j != n - 1) && (array[j].CompareTo(array[j + 1]) < 0))
                        j++;
                    if (array[i].CompareTo(array[j]) < 0)
                    {
                        T tmp = array[j]; array[j] = array[i]; array[i] = tmp;
                    }
                    i = j;
                }
            }
            public void Push(T elem)
            {
                PushHeap(this.buffer, elem);
            }
            public T Pop()
            {
                var v = Peek;
                PopHeap(this.buffer);
                return v;
            }
            public T Peek
            {
                get { return this.buffer[0]; }
            }

            public int Count
            {
                get { return this.buffer.Count; }
            }
        }

    }
}


Measured memory_bytes: 33500