function Main(input){
	input = input.split(" ").map(Number);
	var n = input[0]*(input[0]-1)/2;
	var m = (input[1]<=1)?0:input[1]*(input[1]-1)/2;
	console.log(n+m)
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());