unittest
{
	assert( [ "2 2" ].parse.expand.solve == 1 );
	assert( [ "5 7" ].parse.expand.solve == 24 );
}



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 ab = input.front.split.to!( int[] );
	
	return tuple( ab[ 0 ], ab[ 1 ] );
}

auto solve( in int a, in int b )
{
	return ( a - 1 ) * ( b - 1 );
}
