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

namespace SeleniumTest
{
    class MainClass
    {
        static void Main()
        {
            var inputs = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            var n = inputs[0];
            var m = inputs[1];
            var ak = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
            var q = new PriorityQueue<long>(n);

            foreach (var item in ak) q.Enqueue(item);

            for (int i = 0; i < m; i++)
            {
                var max = q.Dequeue();
                q.Enqueue(max / 2);
            }

            long sum = 0;
            foreach (var item in q.Array)
            {
                sum += item;
            }

            Console.WriteLine(sum);
        }

        /*
        public class PriorityQueue<T> where T : IComparable<T>
        {
            private T[] _heap;
            private int _size = 0;

            public T Peek => _heap[0];

            public PriorityQueue(int maxSize)
            {
                _heap = new T[maxSize];
                _size = 0;
            }

            /// <summary>
            /// 新しい要素を追加
            /// </summary>
            public void Push(T element)
            {
                _size = _size + 1;
                int index = _size - 1;                     // 末尾(追加する要素)のノードの番号
                _heap[index] = element;

                while (index != 0)
                {
                    int parentIndex = (index - 1) / 2;      // 親のノードの番号

                    //親よりも大きければ入れ替え
                    if (_heap[index].CompareTo(_heap[parentIndex]) > 0)
                    {
                        Swap(index, parentIndex);
                        index = parentIndex;
                    }
                    else break;
                }
            }

            /// <summary>
            /// 最大値を取り出す
            /// </summary>
            public T Pop()
            {
                if (_size == 0) return default(T);

                int n = _size - 1;                     // 末尾のノード番号
                var target = _heap[0];
                _heap[0] = _heap[n];
                _size = _size - 1;
                n -= 1;

                var parentIndex = 0;
                while (true)
                {
                    var childIndex = 2 * parentIndex + 1;
                    if (childIndex > n) break;

                    // 子の値の大きい方を選ぶ
                    if (childIndex < n && _heap[childIndex].CompareTo(_heap[childIndex + 1]) < 0) childIndex++;

                    // 子の方が大きければ入れ替え
                    if (_heap[parentIndex].CompareTo(_heap[childIndex]) < 0)
                    {
                        Swap(parentIndex, childIndex);
                        parentIndex = childIndex;
                    }
                    else break;
                }

                return target;
            }

            public void Clear()
                => _size = 0;

            public IEnumerable<T> GetAllElements()
            {
                for (int i = 0; i < _size; i++)
                {
                    yield return Pop();
                }
            }

            private void Swap(int a, int b)
            {
                var tmp = _heap[a];
                _heap[a] = _heap[b];
                _heap[b] = tmp;
            }
        }
    }
    */

        class PriorityQueue<T> where T : IComparable<T>
        {
            public readonly T[] Array;
            public readonly bool Greater;
            public int Count { get; private set; } = 0;

            public PriorityQueue(int capacity, bool greater = true)
            {
                this.Array = new T[capacity];
                this.Greater = greater;
            }

            public void Enqueue(T item)
            {
                this.Array[this.Count] = item;
                this.Count += 1;
                this.UpHeap();
            }

            public T Dequeue()
            {
                // 先頭要素を末尾にして再構成
                this.Swap(0, this.Count - 1);
                this.Count -= 1;
                this.DownHeap();

                return this.Array[this.Count];
            }


            private void UpHeap()
            {
                var n = this.Count - 1;
                while (n != 0)
                {
                    // 親要素の座標
                    var parent = (n - 1) / 2;

                    if (this.Compare(this.Array[n], this.Array[parent]) > 0)
                    {
                        this.Swap(n, parent);
                        n = parent;
                    }
                    else
                    {
                        break;
                    }
                }
            }

            private void DownHeap()
            {
                var parent = 0;
                while (true)
                {
                    var child = 2 * parent + 1;
                    if (child > this.Count - 1) break;

                    if (child < this.Count - 1 && this.Compare(this.Array[child], this.Array[child + 1]) < 0)
                    {
                        // 左より右の子のほうが大きい値の場合、右を入れ替え対象にする
                        child += 1;
                    }

                    if (this.Compare(this.Array[parent], this.Array[child]) < 0)
                    {
                        this.Swap(parent, child);
                        parent = child;
                    }
                    else
                    {
                        break;
                    }
                }
            }

            private int Compare(T a, T b)
            {
                var c = a.CompareTo(b);
                if (!this.Greater)
                {
                    c = -c;
                }
                return c;
            }

            private void Swap(int a, int b)
            {
                var tmp = this.Array[a];
                this.Array[a] = this.Array[b];
                this.Array[b] = tmp;
            }
        }
    }
}

Measured memory_bytes: 32092