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

namespace SplitLength
{
    class Program
    {
        static void Main(string[] args)
        {
            var array = Console.ReadLine().Split().Select(int.Parse).ToArray();
            var N = array[0];
            var M = array[1];

            var priceArray = Console.ReadLine().Split().Select(int.Parse).ToArray();
            var queue = new PriorityQueue<decimal, decimal>(d => d);
            for (int i = 0; i < priceArray.Length; i++)
            {
                queue.Enqueue(priceArray[i]);
            }

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

            Console.WriteLine(queue.Sum(_ => Math.Floor(_)));
        }
        public class PriorityQueue<TKey, TValue> : IEnumerable<TValue>
            where TKey : IComparable<TKey>
        {
            private readonly bool _isDescending;
            private readonly List<KeyValuePair<TKey, TValue>> _data;
            private readonly Func<TValue, TKey> _keySelector;

            public PriorityQueue(Func<TValue, TKey> keySelector, bool isDescending = true)
            {
                _isDescending = isDescending;
                _keySelector = keySelector;
                _data = new List<KeyValuePair<TKey, TValue>>();
            }

            public void Enqueue(TValue item)
            {
                _data.Add(new KeyValuePair<TKey, TValue>(_keySelector(item), item));
                var childIndex = _data.Count - 1;
                while (childIndex > 0)
                {
                    var parentIndex = (childIndex - 1) / 2;
                    if (Compare(_data[childIndex].Key, _data[parentIndex].Key) >= 0)
                        break;

                    Swap(childIndex, parentIndex);
                    childIndex = parentIndex;
                }
            }

            public TValue Dequeue()
            {
                var lastIndex = _data.Count - 1;
                var firstItem = _data[0];
                _data[0] = _data[lastIndex];
                _data.RemoveAt(lastIndex--);

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

                    var rightChild = childIndex + 1;
                    if (rightChild <= lastIndex && Compare(_data[rightChild].Key, _data[childIndex].Key) < 0)
                        childIndex = rightChild;

                    if (Compare(_data[parentIndex].Key, _data[childIndex].Key) <= 0)
                        break;

                    Swap(parentIndex, childIndex);
                    parentIndex = childIndex;
                }
                return firstItem.Value;
            }

            public TValue Peek()
            {
                return _data[0].Value;
            }

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

            private int Compare(TKey a, TKey b)
            {
                return _isDescending ? b.CompareTo(a) : a.CompareTo(b);
            }

            public int Count => _data.Count;

            public IEnumerator<TValue> GetEnumerator()
            {
                return _data.Select(r => r.Value).GetEnumerator();
            }

            IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
        }
        public class PriorityQueue<T> : IEnumerable<T>
            where T : IComparable<T>
        {
            private readonly bool _isDescending;
            private readonly List<T> _data;

            public PriorityQueue(bool isDescending = true)
                : this(0, isDescending)
            {
            }
            public PriorityQueue(int capacity, bool isDescending = true)
            {
                _data = new List<T>(capacity);
                _isDescending = isDescending;
            }

            public void Enqueue(T item)
            {
                _data.Add(item);
                var childIndex = _data.Count - 1;
                while (childIndex > 0)
                {
                    var parentIndex = (childIndex - 1) / 2;
                    if (Compare(_data[childIndex], _data[parentIndex]) >= 0)
                        break;

                    Swap(childIndex, parentIndex);
                    childIndex = parentIndex;
                }
            }

            public T Dequeue()
            {
                var lastIndex = _data.Count - 1;
                var firstItem = _data[0];
                _data[0] = _data[lastIndex];
                _data.RemoveAt(lastIndex--);

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

                    var rightChild = childIndex + 1;
                    if (rightChild <= lastIndex && Compare(_data[rightChild], _data[childIndex]) < 0)
                        childIndex = rightChild;

                    if (Compare(_data[parentIndex], _data[childIndex]) <= 0)
                        break;

                    Swap(parentIndex, childIndex);
                    parentIndex = childIndex;
                }
                return firstItem;
            }

            public T Peek()
            {
                return _data[0];
            }

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

            private int Compare(T a, T b)
            {
                return _isDescending ? b.CompareTo(a) : a.CompareTo(b);
            }

            public int Count => _data.Count;

            public IEnumerator<T> GetEnumerator()
            {
                return _data.GetEnumerator();
            }

            IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
        }
    }
}


Measured memory_bytes: 29916