import scala.io.StdIn

object Main{
  def main(agss: Array[String]): Unit ={
    val num = StdIn.readLine().split(" ").map(a => a.toInt)
    val A = num(0)
    val B = num(1)

    val result = (A - 1) * (B - 1)

    println(result)

  }
}