"use strict";
function main(input) {
  const args = input.split('\n');
  const vars = args[0].split(' ');
  let a = parseInt(vars[0], 10);
  let b = parseInt(vars[1], 10);
  let c = parseInt(vars[2], 10);
  const k = parseInt(args[1], 10);
  for (let i = 0; i < k; i++) {
    if (a > b && a > c) {
      a *= 2;
    } else if (b > a && b > c) {
      b *= 2;
    } else {
      c *= 2;
    }
  }
  console.log(a + b + c);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
