"use strict"
function main(arg) {
    var b =  arg.trim().split(' ')[0];
    var c = arg.trim().split(' ')[1];



     console.log(combination(b,2) + combination(c,2)) 
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

function permutation(n, r) {
for(var i = 0, res = 1; i < r; i++) {
res *= n - i;
}


return res;
}

function combination(n, r) {

    
return permutation(n, r) / permutation(r, r);
}