process.stdin.resume();
process.stdin.setEncoding('utf8');

function _c2(n){
    if (n < 2){
        return 0;
    } else {
        return (n*(n-1))/2;
    }
}

function Main(input){
    line = input.split(" ");
    m = parseInt(line[0]);
    n = parseInt(line[1]);
    ans = _c2(m) + _c2(n);
    console.log(ans);
}

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