function Main(n) {
	const nNumber = getnc2(n[0]);
	const mNumber = getnc2(n[1]);
	console.log(nNumber + mNumber);
}

const getnc2 = (n) => {
	return n * (n - 1) / 2;
};

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