import java.util.*

fun main(args: Array<String>) {
    val scan = Scanner(System.`in`)
    var arr = scan.nextLine().split(" ").map{ it.trim().toInt() }.toTypedArray()
    var a=arr[0]
    var b=arr[1]

    var x=(a*(a-1)/2)
    var y =(b*(b-1)/2)
    println(x+y)
}
