import std.stdio, std.conv, std.string, std.algorithm, std.array, std.math;

void main()
{
  long[] xs = readln.split().to!(long[]);
  long n;
  readf("%d", &n);

  xs = xs.sort().array;
  xs[$-1] = xs[$-1]*pow(2, n);

  writeln(xs.sum());


}
