import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

void main() {
    auto abc = readints;
    int k = readint;

    abc.sort();
    int x = abc[$-1];
    int sum = abc[0] + abc[1] + x * (2 ^^ k);
    writeln(sum);
}
