var numbers = ''
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

reader.on('line', function(line) {
  if (numbers === '') {
    numbers = line
  }
  else {
    showAnswer(line)
  }
});

function showAnswer(number) {
  var inputs = numbers.split(' ')
  var a = parseInt(inputs[0])
  var b = parseInt(inputs[1])
  var c = parseInt(inputs[2])
  var number = parseInt(number)
  var rest;

  var max = Math.max(a,b,c)
  switch(max) {
    case a: 
    rest = b + c
    break
    case b: 
    rest = a + c
    break
    case c: 
    rest = a + b
    break
  }

  for(number; number > 0; number--) {
    max *=  2
  }

  console.log(max + rest)
}