'use strict'

function main(s) {

  s = s.split('\n');

  const nums = s[0].split(' ').map(x => Number(x));
  nums.sort((a, b) => a - b);

  let k = Number(s[1]);

  while (k >= 1) {
    nums[2] = nums[2] * 2;
    k -= 1;
  }

  const ans = nums.reduce((a, b) => a + b );
  console.log(ans);
}

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