object Main extends App {                                                                                                                                      val sc = new java.util.Scanner (System.in)
  val m,n = sc.nextInt
  def prod(x:Int):BigInt = if (x <= 1) BigInt(1) else BigInt(x) * prod(x - 1)
  def comb(num:Int,r:Int):Int= if( r <= num ) (prod(num) / ( prod(num-r) * prod(r))).intValue() else 0
  val result = comb(m,2) + comb(n,2)
  println(result)
}