import std.stdio, std.algorithm, std.string, std.conv, std.array, std.range, std.math;
int readint() { return readln.chomp.to!int; }
int[] readints() { return readln.split.to!(int[]); }
 
 
void main() {
    int[] a = readints();
    a.sort();
    int k = readint();
    foreach(i; 0..k) a[2] *= 2;
    writeln(a.sum);
}
