function Main(input) {
    const lines = input.split('\n');
    const abc = lines[0].split(' ');

    const a = parseInt(abc[0], 10);
    const b = parseInt(abc[1], 10);
    const c = parseInt(abc[2], 10);
    const k = parseInt(lines[1]);

    let largest;
    let sumOthers;
    if(a >= b && a >= c){
        largest = a;
        sumOthers = b + c;
    } else if(b >= c){
        largest = b;
        sumOthers = a + c;
    } else {
        largest = c;
        sumOthers = a + b;
    }

    const answer = largest * Math.pow(2, k) + sumOthers;
    console.log(answer);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));