function Main(input){
	input=input.split(/\n|\s/);
	input.forEach(function(e,i,a){a[i]=Number(a[i]);});
	function ArraySortNumeric(prev,next){return (prev - next);}
	var arr=[input[0],input[1],input[2]];
	arr.sort(ArraySortNumeric);
	
	arr[2]<<=input[3];
	
	console.log(arr[0]+arr[1]+arr[2]);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));