function Main(input) {
	input = input.split(" ");
	var N = parseInt(input[0]);
	var M = parseInt(input[1]);

	var comb_N = (N * (N - 1)) / 2;
	var comb_M = (M * (M - 1)) / 2;

	console.log(comb_N + comb_M);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));