import java.util.Scanner
object Main {
  def main(args:Array[String]) = {
  	val sc = new java.util.Scanner(System.in)
  	val n:Long = sc.nextLong 
  	val m:Long = sc.nextLong
    
	println((n*(n-1))/2 + (m*(m-1))/2)
  }
}