"use strict";
function main(input) {
  let kari = input[0].trim().split(" ").map(i => parseInt(i));
  const n = kari[0];
  const m = kari[1];
  if(n===0 && m ===0){
    console.log(0);
  }else{
    console.log((n*(n-1)/2) + (m*(m-1)/2));
  }

}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"));