
process.stdin.setEncoding('utf-8');
process.stdin.on('data', function (chunk) {
  var lines = chunk.split('\n');
  var nums = lines[0].split(' ');
  var a = Number(nums[0]),
      b = Number(nums[1]),
      c = Number(nums[2]),
      k = Number(lines[1]),
      max = 0,
      sum = 0;

  if (a < b) {
    sum += a;
    max = b;
  } else {
    sum += b;
    max = a;
  }

  if (max < c) {
    sum += max;
    max = c;
  } else {
    sum += c;
  }

  for(var i=0; i<k; i++) {
    max *= 2;
  }
  sum += max;

  console.log(sum);
});
