import scala.io.StdIn; object Solution { def main(args : Array[String]) = { val Array(n,m) = StdIn.readLine().split(" ").map(_.toInt); var count : Long = 0; doCut(n,m) def doCut(x : Long, y : Long) : Int = { if( x ==1 && y ==1) 0 else { if(x >= y) { count += y doCut(x-1,y) } else { count += x doCut(x, y-1) } } } print(count) } }