using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Collections;

static class Extensions
{
    public static int ToInt(this string s) => int.Parse(s);
    public static long ToLong(this string s) => long.Parse(s);
    public static char ToChar(this string s) => char.Parse(s);
    public static double ToDouble(this string s) => double.Parse(s);
    public static int[] ToIntArray(this string s) => s.Replace(',', ' ').Split(' ').Select(x => x.ToInt()).ToArray();
    public static long[] ToLongArray(this string s) => s.Replace(',', ' ').Split(' ').Select(x => x.ToLong()).ToArray();
    public static double[] ToDoubleArray(this string s) => s.Replace(',', ' ').Split(' ').Select(x => x.ToDouble()).ToArray();
    public static Queue<T> ToQueue<T>(this IEnumerable<T> seq) => new Queue<T>(seq);
    public static Stack<T> ToStack<T>(this IEnumerable<T> seq) => new Stack<T>(seq);
    public static HashSet<T> ToHashSet<T>(this IEnumerable<T> seq) => new HashSet<T>(seq);
}

static class MyMath
{
    static public long GCD(long a, long b) => (a < b) ? GCD(b, a) : ((b == 0) ? a : GCD(b, a % b));
    static public long LCM(long a, long b) => (a > b) ? (a / GCD(a, b) * b) : (b / GCD(a, b) * a);
    static private readonly long _m = 1000000000 + 7;
    static public long Mod(long val) => (val % _m + _m) % _m;
    static private long ExtGCD(long a, long b, ref long x, ref long y) => (b == 0) ? (a + (x = 1) * 0 + (y = 0) * 0) : (ExtGCD(b, a % b, ref y, ref x) + (y -= a / b * x) * 0);
    static private long ModInverseInner(long a, long dummy1 = 0, long dummy2 = 0) => ExtGCD(a, _m, ref dummy1, ref dummy2) * 0 + Mod(dummy1);
    static public long ModInverse(long a) => ModInverseInner(a, 0, 0);
}

class Program
{
    static string[] ReadLines(int n) => Enumerable.Range(0, n).Select(s => Console.ReadLine()).ToArray();

    static void Main()
    {
        int[] nm = Console.ReadLine().ToIntArray();
        int N = nm[0];
        int M = nm[1];
        long[] itemList = Console.ReadLine().ToLongArray();

        var q = PriorityQueue<long>.Create(n => n, PriorityKind.BiggerIsPrior);

        foreach(var item in itemList)
        {
            q.Enqueue(item);
        }

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

        Console.WriteLine(q.Sum());
    }

    public enum PriorityKind
    {
        BiggerIsPrior,
        SmallerIsPrior,
    }

    public abstract class PriorityQueue<T> : IEnumerable<T>
    {
        public static PriorityQueue<T> Create<U>(Func<T, U> prioritySelector, PriorityKind kind)
        {
            return new PriorityQueueInner<T, U>(prioritySelector, kind);
        }

        public abstract IEnumerator<T> GetEnumerator();

        public abstract void Enqueue(T item);

        public abstract T Dequeue();

        IEnumerator IEnumerable.GetEnumerator()
        {
            return this.GetEnumerator();
        }

        /// <summary>
        /// 優先度順に取り出されるキュー
        /// </summary>
        /// <typeparam name="T"></typeparam>
        private class PriorityQueueInner<T, U> : PriorityQueue<T>
        {
            private Comparison<T> comparison;

            private List<T> heap = new List<T>();

            /// <summary>
            /// 優先度セレクタを指定して初期化
            /// </summary>
            /// <param name="comparison"></param>
            public PriorityQueueInner(Func<T, U> prioritySelector, PriorityKind kind)
            {
                var comparer = Comparer<U>.Default;

                Comparison<T> biggerPriorComparison = (T x, T y) =>
                {
                    return comparer.Compare(prioritySelector(y), prioritySelector(x));
                };

                Comparison<T> smallerPriorComparison = (T x, T y) =>
                {
                    return comparer.Compare(prioritySelector(x), prioritySelector(y));
                };

                if (kind == PriorityKind.BiggerIsPrior)
                {
                    this.comparison = biggerPriorComparison;
                }
                else
                {
                    this.comparison = smallerPriorComparison;
                }
            }

            public override void Enqueue(T item)
            {
                heap.Add(item);

                int i = heap.Count - 1;
                while (i > 0)
                {
                    //親のノードの番号
                    int p = (i - 1) / 2;

                    //もう逆転していないなら抜ける
                    if (comparison(item, heap[p]) >= 0) break;

                    //親のノードの数字を下ろして、自分は上に
                    heap[i] = heap[p];
                    i = p;
                }

                heap[i] = item;
            }

            public override T Dequeue()
            {
                int nextSize = heap.Count - 1;

                T ret = heap[0];

                //根に持ってくる値
                T x = heap[nextSize];

                //根から下ろしていく
                int i = 0;
                while (i * 2 + 1 < nextSize)
                {
                    //子同士を比較
                    int a = i * 2 + 1;
                    int b = i * 2 + 2;
                    if (b < nextSize && comparison(heap[a], heap[b]) > 0) a = b;

                    //もう逆転していないなら終わり
                    if (comparison(heap[a], x) >= 0) break;

                    //子の数字を持ち上げる
                    heap[i] = heap[a];
                    i = a;
                }

                heap[i] = x;
                heap.RemoveAt(nextSize);
                return ret;
            }

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

            public int Count => heap.Count;
        }
    }
}

Measured memory_bytes: 29532