function Main(input) {
    tmp = input.split(" ");
    sub = input.split("\n");
    var a = parseInt(tmp[0], 10);
    var b = parseInt(tmp[1], 10);
    var c = parseInt(tmp[2], 10);
    var d = parseInt(sub[1], 10);
    var arr = [a, b, c];
    arr.sort();
    d++;
    //処理
    fint = arr[0];
	for (i=1;i<d;i++) {
		fint = fint*2;
	}
    result = (fint + arr[1] + arr[2])
    //結果
    console.log(result);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));