unittest
{
	assert( [ "5 2" ].parse.expand.solve == 18 );
	assert( [ "3 -1" ].parse.expand.solve == 0 );
	assert( [ "30 -50" ].parse.expand.solve == -1044 );
}



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

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

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto nl = input.front.split.to!( long[] );
	return tuple( nl[ 0 ], nl[ 1 ] );
}

auto solve( long n, long l )
{
	auto t = n * l + ( ( n - 1 ) * n ) / 2;
	auto mi = l;
	auto ma = l + n - 1;
	if( ma < 0 ) return t - ma;
	if( 0 < mi ) return t - mi;
	return t;
}
