"use strict"

function main(input){
  const args = input.split(' ');
  const N = args[0];
  const M = args[1];

  var ans = 0;
  if(2 <= N){
    ans += N*(N-1)/2;
  }
  if(2 <= M){
    ans += M*(M-1)/2;
  }

  console.log(ans);




}

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