function Main(s) {
  s = s.split("\n");
  s[0] = s[0].split(" ").map(a => +a);
  s[1] = +s[1];
  var m = Math.max(...s[0]);
  console.log(s[0][0] + s[0][1] + s[0][2] + (m << s[1]) - m);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));