"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;
   }
   //console.log(ans);
   
   let ans1=0;
   if(M>1){
     ans1=M;
   }else{
     ans1=0;
   }
   //console.log(ans1);
   console.log(ans+ans1);
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));