fun main(args: Array<String>) {
    val (a, b) = getInts()
    println("${a * (a - 1) / 2 + b * (b - 1) / 2}")
}

fun getInt() = readLine()!!.toInt()
fun getInts() = readLine()!!.split(" ").map { it.toInt() }