function main(input) {
	const args = input.split(' ');
	const N = parseInt(args[0], 10);
	const M = parseInt(args[1], 10);
    console.log(conbination(N, M));
    
}

function conbination(n, m) {
    const ans1 = (n * (n - 1) / 2) * 10 % 10 === 0 ? n * (n - 1) / 2 : 0;
    const ans2 = (m * (m - 1) / 2) * 10 % 10 === 0 ? m * (m - 1) / 2 : 0;
    return ans1 + ans2;
}

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