fun main(args: Array<String>){
    val(n,m) = readLine()!!.split(" ").map{it.toInt()}
    var kind = 0
    if(m > 1 && n > 1) {
         kind = combination(m) + combination(n)
    }else if(m < 2 && n > 1){
         kind = combination(n)
    }else if(m > 1 && n < 2){
        kind = combination(m)
    }else{
        println(kind)
        return
    }
    println(kind)
}

fun combination(x: Int) : Int{
    return (x * (x-1)) / 2
}