object Main extends App {
  var input = readLine
  val Evens = input.split(" ")(0).toInt - 1
  val Odds  = input.split(" ")(1).toInt - 1
  
  var count = 0
  
  for(i <- 0 to Evens) {
    count = count + i
  }
  
  for(j <- 0 to Odds) {
    count = count + j
  }
  
  println(count)
  
}