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

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

  var largest = Math.max(a, b, c);
  var othersSum;

  switch (largest) {
    case a:
      othersSum = b + c;
      break;
    case b:
      othersSum = a + c;
      break;
    default:
      othersSum = a + b;
  }

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