unittest
{
	assert( [ "4", "3" ].parse.expand.solve == 10 );
	assert( [ "10", "10" ].parse.expand.solve == 76 );
}



import std.conv;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto n = input.front.strip.to!( long );
	input.popFront;
	auto k = input.front.strip.to!( long );
	return tuple( n, k );
}

auto solve( long n, long k )
{
	auto x = 1L;
	
	foreach( i; 0 .. n )
	{
		if( x < k ) x *= 2;
		else        x += k;
	}
	
	return x;
}
