fun main(args: Array<String>) {
    val (even, odd) = readLine()!!.split(" ").map(String::toInt)
    var a = 0
    var b = 0
    if (even > 1) {
        a = even * (even - 1) / 2
    }
    if (odd > 1) {
        b = odd * (odd - 1) / 2
    }
    println(a + b)
}