function Main(input) {
    input = input.split("\n");
    for (i=0; i < input.length; i++) {
        tmp = input[i].split(" ")
        var N = parseInt(tmp[0])
        var M = parseInt(tmp[1])
        var r = 0
        r += N * (N-1) / 2
        r += M * (M-1) / 2
        console.log('%d',r)
    }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
