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.Push(item);

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

            long sum = 0;
            foreach (var item in q.GetAllElements(false))
            {
                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>
        {
            private readonly T[] _array;
            public readonly bool _greater;
            public int Count { get; private set; } = 0;

            public PriorityQueue(int capacity, bool greater = true)
            {
                _array = new T[capacity];
                _greater = greater;
            }

            public void Push(T item)
            {
                _array[this.Count] = item;
                Count += 1;
                PushHeap();
            }

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

                return _array[Count];
            }

            public IEnumerable<T> GetAllElements(bool withPop = true)
            {
                int count = Count;
                for(int i = 0; i < count; i++)
                {
                    if (withPop) yield return Pop();
                    else yield return _array[count - i - 1];
                }
            }

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

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

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

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

                    if (Compare(_array[parent], _array[child]) < 0)
                    {
                        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 = _array[a];
                _array[a] = _array[b];
                _array[b] = tmp;
            }
        }
    }
}

Measured memory_bytes: 32220