fun main(args: Array<String>) {
    val (N, M) = readLine()!!.split(" ").map(String::toLong)
    val ans = combination(N + M, 2) - N * M
    println(ans)
}

fun combination(n: Long, k: Long): Long {
    var a = 1L
    var b = 1L
    val min = k.coerceAtMost(n - k)
    for (i in n - min + 1..n) {
        a *= i
    }
    for (i in 1..min) {
        b *= i
    }
    return a / b
}