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 PriorityQueue4<decimal>(priceArray.Length, (a,b)=>b.CompareTo(a));
            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.m_list.Sum(_ => Math.Floor(_)));
        }

        class PriorityQueue4<T>
        {
            public readonly List<T> m_list;
            private readonly Func<T, T, int> m_compare;
            private int m_count;
            public PriorityQueue4(int capacity, Func<T, T, int> compare)
            {
                m_list = new List<T>(capacity);
                m_compare = compare;
                m_count = 0;
            }
            private int Add(T value)
            {
                if (m_count == m_list.Count)
                {
                    m_list.Add(value);
                }
                else
                {
                    m_list[m_count] = value;
                }
                return m_count++;
            }
            private void Swap(int a, int b)
            {
                T tmp = m_list[a];
                m_list[a] = m_list[b];
                m_list[b] = tmp;
            }
            public void Enqueue(T value)
            {
                int c = Add(value);
                while (c > 0)
                {
                    int p = (c - 1) / 2;
                    if (m_compare(m_list[c], m_list[p]) < 0) { Swap(p, c); } else { break; }
                    c = p;
                }
            }
            public T Dequeue()
            {
                T value = m_list[0];
                m_list[0] = m_list[--m_count];
                int p = 0;
                while (true)
                {
                    int c1 = p * 2 + 1;
                    int c2 = p * 2 + 2;
                    if (c1 >= m_count) { break; }
                    int c = (c2 >= m_count || m_compare(m_list[c1], m_list[c2]) < 0) ? c1 : c2;
                    if (m_compare(m_list[c], m_list[p]) < 0) { Swap(p, c); } else { break; }
                    p = c;
                }
                return value;
            }
        }
        public class PriorityQueue3<T> : IEnumerable<T>
        {
            private readonly IComparer<T> _comparer;
            private readonly List<T> _data;
            private readonly bool _isDescending;

            public PriorityQueue3(IComparer<T> comparer, bool isDescending = true)
            {
                _comparer = comparer;
                _data = new List<T>();
                _isDescending = isDescending;
            }

            public PriorityQueue3(Comparison<T> comparison, bool isDescending = true)
                : this(Comparer<T>.Create(comparison), isDescending)
            {
            }

            public PriorityQueue3(bool isDescending = true)
                : this(Comparer<T>.Default, 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 ? _comparer.Compare(b, a) : _comparer.Compare(a, b);
            }

            public int Count => _data.Count;

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

            IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
        }
        public class PriorityQueue2<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 PriorityQueue2(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: 27868