import scala.io

object Main extends App {
  val lines = io.Source.stdin.getLines
  val Array(n, m) = lines.next().split(" ").map(_.toInt)

  val twoFromN = if (n > 1) {
    n * (n - 1) / 2    
  } else 0
  val twoFromM = if (m > 1) {
    m * (m - 1) / 2
  } else 0
  
  println(twoFromN + twoFromM)
}
