
import java.util.*

fun main( argv : Array<String> ) {
    
    val scan = Scanner(System.`in`)
    
    //
    val n = scan.nextInt()
    val m = scan.nextInt()
    
    //
    println( (n-1)*(m-1) )

}