// inputに入力データ全体が入る
function Main(input) {
    input = input.split(" ");
    var N = parseInt(input[0],10);
    var L = parseInt(input[1],10);
    var aziSouwa = [];
    for(var i = 1; i < N+1; i++){
        aziSouwa.push(L + i - 1);
    }
    var souwa = aziSouwa.reduce(function(total, data){return total + data});
    var res = getClosestNum(0,aziSouwa);
    console.log(res);
};
function getClosestNum(num, ar){
    var closest;
    if(Object.prototype.toString.call(ar) ==='[object Array]' && ar.length>0){
      closest = ar[0];
      for(var i=0;i<ar.length;i++){ 
         var closestDiff = Math.abs(num - closest);
         var currentDiff = Math.abs(num - ar[i]);
         if(currentDiff < closestDiff){
             closest = ar[i];
         }
       }
       return closest;
     }
  return false;
 }
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));