function main(input) {
    var a = input[0].split(" ")[0]-0;
    var b = input[0].split(" ")[1]-0;
    var c = input[0].split(" ")[2]-0;
    var k = input[1]-0;
    var arr = [a,b,c].sort((a,b)=>a-b);
    arr[2]*=Math.pow(2,k);
    
    console.log(arr[0]+arr[1]+arr[2]);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"))
