fun main(args :Array<String>){
  var input:String?=readLine()
  var nums:List<String> =input!!.split(" ")
  var odd=nums[0].toInt()
  var even=nums[1].toInt()
  var sum:Int =0
  if(odd>1){
    for(i in 1 until odd){
      sum+=i
    }
  }
  if(even>1){
    for(j in 1 until even){
      sum+=j
    }
  }
  println(sum)
}