#include<bits/stdc++.h>
#define ll long long
#define rep(i,a,b) for(i=a;i<b;i++)
#define pb push_back
#define all(v) v.begin(),v.end()
#define F first
#define S second
#define vi vector < ll  int >
#define CLR(a) memset((a),0,sizeof(a))
#define mp make_pair
#define hell 1000000007
using namespace std;

 //int dp[1001][1001];
 /*
vector < int > tree(400005);

void buildtree (vector < int > v,int node,int start,int fin)
  {
      if(start==fin)
      {
          tree[node]=v[start];
          return;
      }
      int mid=(start+fin)/2;
      buildtree(v,2*node,start,mid);
      buildtree(v,2*node+1,mid+1,fin);
      tree[node]=tree[2*node]+tree[2*node+1];
  }

 int sum (int node,int tl,int tr,int l , int r)
   {
       if(l>r) return 0;
       if(l==tl and r==tr) return tree[node];
       int mid=(tl+tr)/2;
       return sum(2*node,tl,mid,l,min(r,mid))+sum(2*node+1,mid+1,tr,max(l,mid+1),r);
   }

  void update(int node,int tl , int tr,int pos,int val)
    {
        if(tl==tr) {tree[node]=val; return;}
        int mid=(tl+tr)/2;
        if(pos<=mid)
              update(2*node,tl,mid,pos,val);
        else
            update(2*node+1,mid+1,tr,pos,val);
        tree[node]=tree[2*node]+tree[2*node+1];

    }
string findSum(string str1, string str2)
{
    // Before proceeding further, make sure length
    // of str2 is larger.
    if (str1.length() > str2.length())
        swap(str1, str2);

    // Take an empty string for storing result
    string str = "";

    // Calculate length of both string
    int n1 = str1.length(), n2 = str2.length();

    // Reverse both of strings
    reverse(str1.begin(), str1.end());
    reverse(str2.begin(), str2.end());

    int carry = 0;
    for (int i=0; i<n1; i++)
    {
        // Do school mathematics, compute sum of
        // current digits and carry
        int sum = ((str1[i]-'0')+(str2[i]-'0')+carry);
        str.push_back(sum%10 + '0');

        // Calculate carry for next step
        carry = sum/10;
    }

    // Add remaining digits of larger number
    for (int i=n1; i<n2; i++)
    {
        int sum = ((str2[i]-'0')+carry);
        str.push_back(sum%10 + '0');
        carry = sum/10;
    }

    // Add remaining carry
    if (carry)
        str.push_back(carry+'0');

    // reverse resultant string
    reverse(str.begin(), str.end());

    return str;
}
*/
   bool vis[100005];

void dfs(vector < vector < int > > &g ,int s)
{
    vis[s]=true;
    for(auto it : g[s])
        if(!vis[it]) dfs(g,it);
}
void solve()
{
   ll int i,j=0,r=200,p,q,k,d,y=0,h,flag=1,n,m=0,a=hell,b=hell,id,h1,h2,a1,b1,a2,w,x,u,f,l;
   cin>>n>>m;
   vi v(n);
   priority_queue < ll > pq;
   rep(i,0,n)
   {
       cin>>v[i];
       pq.push(v[i]);

   }
  if(pq.size()==1)
  {   k=pq.top();
      while(m>0 and k>0)
      {
          k/=2;
          m--;
      }
      cout<<k; return;
  }
  while(m>0 and pq.top()>0)
  {

      k=pq.top();
      pq.pop();
      d=pq.top();
      while(k>=d and m>0)
      {
          k/=2;
          m--;
      }
      pq.push(k);
  }
  y=0LL;
 while(!pq.empty())
 {
     y+=pq.top();
     pq.pop();
 }
cout<<y;

}


signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    //cin>>t;
    while(t--)
     solve();
}


Measured memory_bytes: 2168