function main (s) {
    s=s.split(/[" ","\n"]/);
	for(var i=0;i<4;i++)s[i]=parseInt(s[i]);
	var t=Math.max(s[0],s[1],s[2]);
	var res=s[0]+s[1]+s[2]-t;
	for(var i=1;i<=s[3];i++)t*=2;
	res+=t;
	console.log(res);
}
 
main(require('fs').readFileSync('/dev/stdin', 'utf8'));