import java.util.Scanner

fun main(args: Array<String>){
    val scn = Scanner(System.`in`)
    val list = scn.nextLine().split(" ")
    val N = list[0].toInt()
    val M = list[1].toInt()

    val result = (M*(M-1)/2) + (N*(N-1)/2)
    print("$result")


}