function main(input) {
  input=input.trim();
  const a = parseInt(input.split(" ")[0], 10);
  const b = parseInt(input.split(" ")[1], 10);
  const c = parseInt(input.split(" ")[2], 10);
  const x = parseInt(input.split("\n")[1], 10);
  console.log(Math.max.apply(null,[a,b,c])*Math.pow(2,x)+a+b+c-Math.max.apply(null, [a,b,c]));

  

}


main(require('fs').readFileSync('/dev/stdin', 'utf8'));
