fun main(args: Array<String>) {
    val input = readLine()!!.split(" ").map { it.toInt() }

    val even = if (input[0] > 1) {
        input[0].let { it * (it - 1) / 2 }
    } else {
        0
    }
    val odd = if (input[1] > 1) {
        input[1].let { it * (it - 1) / 2 }
    } else {
        0
    }

    println(even + odd)
}