fun main(args: Array<String>) = ABC159A.main()

object ABC159A {
    fun readInt() = readLine()!!.toInt()
    fun readInts() = readLine()!!.split(" ").map { it.toInt() }


    fun main() {
        val (n,m)= readInts()
        val s = n+m
        println(s.C(2) - n*m)
    }


    /*####################################################################################*/


    fun Int.factorial(): Int = when {
        this < 0 -> throw IllegalArgumentException()
        this == 0 -> 1
        else -> (1..this).binaryMerge { a, b -> a * b }
    }

    fun Int.P(k: Int): Int = (this - k + 1..this).binaryMerge { a, b -> a * b }

    fun Int.C(k: Int): Int = this.P(k) / k.factorial()


    fun <T> List<T>.binaryMerge(operation: (a: T, b: T) -> T): T? {
        when (this.size) {
            0 -> return null
            1 -> return this[0]
            2 -> return operation(this[0], this[1])
            3 -> return operation(this[0], operation(this[1], this[2]))
        }
        val half = this.size / 2
        val leftSide = this.subList(0, half - 1)
        val rightSide = this.subList(half, this.lastIndex)
        return operation(leftSide.binaryMerge(operation)!!, rightSide.binaryMerge(operation)!!)
    }

    fun IntRange.binaryMerge(operation: (a: Int, b: Int) -> Int): Int = this.toList().binaryMerge(operation)!!
}