unittest
{
	assert( [ "3 4" ].parse.expand.solve == 6 );
	assert( [ "2 2" ].parse.expand.solve == 1 );
}



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

auto solve( long n, long m )
{
	return ( n - 1 ) * ( m - 1 );
}
