'use strict';
function main(input) {
  input = input.split(' ');
  const a = parseInt(input[0], 10);
  const b = parseInt(input[1], 10);

  const sum = (a > 1 ? a * (a - 1) / 2 : 0) + (b > 1 ? b * (b - 1) / 2 : 0)

  console.log(sum);
}

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