// Author -> Preeyadarshee Dev
//
// train hard win easy :D
// nik is love
// nik is motivation
//
// do modulo operations very carefully
// try to avoid binary search, use linear search preferrably to make calculations easier
// always make your custom binary search and watch out for overflows
// read the problems carefully
// never rely on floating point calculation
#include<bits/stdc++.h>
#define mp                    make_pair
#define pb                    push_back
#define ll                    long long
#define ss                       second
#define ff                        first
#define fr(i,a,b)   for(ll i=a;i<b;i++)
#define f(i,n)                fr(i,0,n)
#define rf(i,b,a) for(ll i=b-1;i>=a;i--)
#define r(i,n)                rf(i,n,0)
#define inf                   1000000007
#define eps                   0.000000000000001
#define sz(a)                int((a).size())
#define all(c)               (c).begin(),(c).end()
#define tr(c,i)              for(typeof(c).begin() i = (c).begin(); i != (c).end(); i++)
#define present(c,x)         ((c).find(x) != (c).end())
#define cpresent(c,x)        (find(all(c),x) != (c).end())
#define pi                   pair<int,int>
#define pll                  pair < ll , ll >
#define endl                 '\n'
#define PI                   3.141592653589793238462643383279502884197169399375105820974944592307816406286
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
typedef vector< int > vi;
typedef vector< vi > vvi;
int dx[8]={1,-1,0,0,-1,-1,1,1};
int dy[8]={0,0,-1,1,-1,1,-1,1};
vector<int> adj[200010],vis(200010,0),dis(200010,inf),fin(200010,0),col(200010,0),par(200010,0);
int myrandom (int i) { return std::rand()%i;}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //ifstream fin;
    //ofstream fout;
    //fin.open("input.txt");
    //fout.open("output.txt");
    ll n,m;
    cin>>n>>m;
    priority_queue<ll> pq;
    for(int i=0;i<n;i++)
    {
        ll a;
        cin>>a;
        pq.push(a);
    }
    while(m>0&&!pq.empty())
    {
        auto v=pq.top();
        pq.pop();
        if(!pq.empty())
        {
            while(m>0&&v>=pq.top())
            {
                v=v/2;
                m--;
            }
        }
        else
        {
            while(m>0&&v>0)
            {
                v=v/2;
                m--;
            }
        }
        if(v>0)
        {
            pq.push(v);
        }
    }
    ll sum=0;
    while(!pq.empty())
    {
        sum=sum+pq.top();
        pq.pop();
    }
    cout<<sum<<endl;
}
// 11906472
// YHUHA8ZBJH
// Preeyadarshee Dev Team 808db2e1
/*
 int a1,a2,k1,k2,n;
 cin>>a1>>a2>>k1>>k2>>n;
 int num=(k1-1)*a1+(k2-1)*a2;
 if(n-num<=0)
 {
 cout<<0<<" ";
 }
 else
 {
 cout<<min(n-num,a1+a2)<<" ";
 }
 int maxi=0;
 for(int i=1;i<=n;i++)
 {
 int j=n-i;
 maxi=max(maxi,min((i/k1),a1)+min((j/k2),a2));
 }
 cout<<maxi<<endl;
 */
/*
 int n;
 cin>>n;
 string s,t;
 cin>>s>>t;
 deque<int> v[2];
 vector<int> cnt(2,0);
 for(int i=0;i<n;i++)
 {
 if(s[i]=='a'&&t[i]=='b')
 {
 cnt[0]++;
 v[0].pb(i);
 }
 else if(s[i]=='b'&&t[i]=='a')
 {
 cnt[1]++;
 v[1].pb(i);
 }
 }
 vector<pair<int,int>> ans;
 while((int)v[0].size()>1)
 {
 ans.pb({v[0].front()+1,v[0].back()+1});
 v[0].pop_front();
 v[0].pop_back();
 }
 while((int)v[1].size()>1)
 {
 ans.pb({v[1].front()+1,v[1].back()+1});
 v[1].pop_front();
 v[1].pop_back();
 }
 if(!v[0].empty()&&!v[1].empty())
 {
 ans.pb({v[0].front()+1,v[0].back()+1});
 ans.pb({v[0].front()+1,v[1].back()+1});
 
 }
 else if(!v[0].empty()||!v[1].empty())
 {
 cout<<-1<<endl;
 return 0;
 }
 cout<<(int)ans.size()<<endl;
 for(auto i:ans)
 {
 cout<<i.ff<<" "<<i.ss<<endl;
 }
 */


Measured memory_bytes: 9976