
import std.algorithm;
import std.conv;
import std.stdio;
import std.string;

void main()
{
	auto abc = readln.split.map!( to!int );
	auto k = readln.strip.to!int;
	
	writeln( solve( abc[ 0 ], abc[ 1 ], abc[ 2 ], k ) );
}

int solve( in int a, in int b, in int c, in int k )
{
	auto m = max( a, b, c );
	int md = m;
	foreach( i; 0 .. k )
	{
		md *= 2;
	}
	return a + b + c + ( md - m );

}

unittest
{
	assert( solve( 5, 3, 11, 1 ) == 30 );
	assert( solve( 3, 3, 4, 2 ) == 22 );
}
