"use strict";
const Main = (input) =>{
   let xs = input.trim().split(' ').map(v=>parseInt(v,10));
　 let N = xs[0];
   let M = xs[1];
   
   let ans = 0;
   for(let i=0; N>i; i++){
   ans += i;
   }
   let ans1=0;
   for(let i=0; M>i; i++){
   ans1 += i;
   }
   console.log(ans+ans1);
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));