program main
	implicit none
	integer n,m,l
	read(*,*)n,m
	l=(n-1)*(m-1)
	if(l<10)then
		write(*,'(i1)')l
	elseif(l<100)then
		write(*,'(i2)')l
	elseif(l<1000)then
		write(*,'(i3)')l
	else
		write(*,'(i4)')l
	endif
end program main
