function main(input) {
    const args = input.split(' ');
    const a = parseInt(args[0], 10);
    const b = parseInt(args[1], 10);
    let sum=0;
    if(a>3){
        sum=sum+(a*(a-1))/2
    }
    if(b>3){
        sum=sum+(b*(b-1))/2
    }
    console.log(sum);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));