import java.util.Scanner


import scala.io.StdIn._

object Main extends App {

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


  def solve() = {
    val odd = if(m >= 2) m * (m-1) / 2 else 0
    val even = if(n >= 2) n * (n-1) / 2 else 0
    odd + even
  }

  println(solve())

}

