import scala.io.StdIn._

object Main extends App {

  val Array(n, m) = readLine.split(" ").map(_.toInt)

  val doubleEven = (n * (n - 1)) / 2
  val doubleOdd = (m * (m - 1)) / 2

  val ans = doubleEven + doubleOdd

  println(ans)
}

