"use strict";

// 二分探索
const searchInsert = (array, target) => {
    let high = array.length - 1;
    let low = 0;
    
    while(low <= high){
        let mid = Math.floor((low + high) / 2);
      
        if(array[mid] === target)
            return mid;
        if(array[mid] > target)
            high = mid - 1;
        else
            low = mid + 1;
    }

    return low;
}

const main = arg => {
    arg = arg.trim().split("\n");
    const N = parseInt(arg[0].split(" ")[0]);
    const M = parseInt(arg[0].split(" ")[1]);
    
    const A = arg[1].split(" ").map(n=>parseInt(n)).sort((a,b)=>a-b);
    
    
    for(let i=0; i<M; i++) {
        const highest = A[A.length - 1];
        const halfed   = Math.floor(highest / 2);
        
        A.pop();
        
        const insertPoint = searchInsert(A, halfed);
        
        A.splice(insertPoint, 0, halfed);
    }

    console.log(A.reduce((m,n)=>m+n));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
