import java.util.Scanner


import scala.io.StdIn._

object Main extends App {

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


  def solve() = {
    f(n) + f(m)
  }
  
  def f(x: Int): Int =
    if(x >= 2) x * (x-1) / 2 else 0

  println(solve())

}

