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

namespace PAST0
{
    using static Ex;
    public class Solve
    {
        public static void Main(string[] args)
        {
            new PAST_H();
        }
    }
    public class PAST_H
    {
        long n, m;
        public PAST_H()
        {
            var l0 = ReadLongArray();
            n = l0[0];
            m = l0[1];
            var l = ReadLongArray();

            var pq = new PriorityQueue<long>();

            long ans = 0;
            foreach (var v in l)
            {
                pq.Push(v);
                ans += v;
            }

            while (m > 0)
            {
                var d = pq.Pop();
                var i = (int)Math.Floor(d / 2.0);
                pq.Push(i);
                ans -= d - i;
                m--;
            }

            ans.Cw();
        }
    }
    public class PAST_I
    {
        public PAST_I()
        {
        }
    }
    public class PAST_J
    {
        public PAST_J()
        {
        }
    }
    public static class Ex
    {
        public static void Cw(this object s) { Console.WriteLine(s); }



        public static bool Mins<T>(ref T a, T b) where T : IComparable<T> { if (a.CompareTo(b) > 0) { a = b; return true; } return false; }
        public static bool Maxs<T>(ref T a, T b) where T : IComparable<T> { if (a.CompareTo(b) < 0) { a = b; return true; } return false; }
        public static void Swap<T>(ref T a, ref T b) { var t = b; b = a; a = t; }
        public static void Swap<T>(List<T> list, int i, int j) { T tmp = list[j]; list[j] = list[i]; list[i] = tmp; }


        static long Gcd(long m, long n) { if (n == 0) return m; return Gcd(n, m % n); }
        public static List<string> FastSort(this List<string> s) { s.Sort(StringComparer.Ordinal); return s.ToList(); }
        public static void yesno(this bool b) { (b ? "yes" : "no").Cw(); }
        public static void YesNo(this bool b) { (b ? "Yes" : "No").Cw(); }
        public static void YESNO(this bool b) { (b ? "YES" : "NO").Cw(); }

        public static string Read { get { return Console.ReadLine().Trim(); } }
        public static int ReadInt { get { return int.Parse(Read); } }
        public static long ReadLong { get { return long.Parse(Read); } }
        public static double ReadDouble { get { return double.Parse(Read); } }
        public static string[] ReadArray() { return Read.Split(' '); }
        public static int[] ReadIntArray() { return Read.Split(' ').Select(int.Parse).ToArray(); }
        public static long[] ReadLongArray() { return Read.Split(' ').Select(long.Parse).ToArray(); }
        public static string[] ReadArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret; }
        public static int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
        public static long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }


        public class PriorityQueue<T> where T : IComparable<T>
        {
            List<T> list;
            public PriorityQueue() { list = new List<T>(); }
            public PriorityQueue(int capacity) { list = new List<T>(capacity); }
            void PushHeap(T elem)
            {
                int n = list.Count;
                list.Add(elem);

                while (n != 0)
                {
                    int i = (n - 1) / 2;
                    if (list[n].CompareTo(list[i]) > 0)
                        Swap(list, i, n);
                    n = i;
                }
            }
            void PopHeap()
            {
                int n = list.Count - 1;
                list[0] = list[n];
                list.RemoveAt(n);

                for (int i = 0, j; (j = 2 * i + 1) < n;)
                {
                    if ((j != n - 1) && (list[j].CompareTo(list[j + 1]) < 0))
                        j++;
                    if (list[i].CompareTo(list[j]) < 0)
                        Swap(list, i, j);
                    i = j;
                }
            }
            public void Push(T elem) { PushHeap(elem); }
            public T Pop() { var v = Peek; PopHeap(); return v; }
            public T Peek { get { return list[0]; } }
            public int Count { get { return list.Count; } }
        }

    }
    public struct Mod : IEquatable<Mod>, IEquatable<long>
    {
        static public long _mod = 1000000007; long v;
        public Mod(long x) { if (x < _mod && x >= 0) v = x; else if ((v = x % _mod) < 0) v += _mod; }
        static public implicit operator Mod(long x) => new Mod(x);
        static public implicit operator long(Mod x) => x.v;
        public void Add(Mod x) { if ((v += x.v) >= _mod) v -= _mod; }
        public void Sub(Mod x) { if ((v -= x.v) < 0) v += _mod; }
        public void Mul(Mod x) => v = (v * x.v) % _mod;
        public void Div(Mod x) => v = (v * Inverse(x.v)) % _mod;
        static public Mod operator +(Mod x, Mod y) { var t = x.v + y.v; return t >= _mod ? new Mod { v = t - _mod } : new Mod { v = t }; }
        static public Mod operator -(Mod x, Mod y) { var t = x.v - y.v; return t < 0 ? new Mod { v = t + _mod } : new Mod { v = t }; }
        static public Mod operator *(Mod x, Mod y) => x.v * y.v;
        static public Mod operator /(Mod x, Mod y) => x.v * Inverse(y.v);
        static public bool operator ==(Mod x, Mod y) => x.v == y.v;
        static public bool operator !=(Mod x, Mod y) => x.v != y.v;
        static public long Inverse(long x) { long b = _mod, r = 1, u = 0, t = 0; while (b > 0) { var q = x / b; t = u; u = r - q * u; r = t; t = b; b = x - q * b; x = t; } return r < 0 ? r + _mod : r; }
        public bool Equals(Mod x) => v == x.v;
        public bool Equals(long x) => v == x;
        public override bool Equals(object x) => x == null ? false : Equals((Mod)x);
        public override int GetHashCode() => v.GetHashCode();
        public override string ToString() => v.ToString();
        static List<Mod> _fact = new List<Mod>() { 1 };
        static void B(long n) { if (n >= _fact.Count) for (int i = _fact.Count; i <= n; ++i) _fact.Add(_fact[i - 1] * i); }
        static public Mod Comb(long n, long k) { B(n); if (n == 0 && k == 0) return 1; if (n < k || n < 0) return 0; return _fact[(int)n] / _fact[(int)(n - k)] / _fact[(int)k]; }
        static public Mod Perm(long n, long k) { B(n); if (n == 0 && k == 0) return 1; if (n < k || n < 0) return 0; return _fact[(int)n] / _fact[(int)(n - k)]; }
    }
}


Measured memory_bytes: 31452