function main(input) {
  const inputList = input.split(/\s/).map(inp => formatNum(inp));
  const apple = inputList[0];
  var ajiList = [];
  for (var i = 1; i <= apple; i++) {
    ajiList.push(inputList[1] - 1 + i);
  }
  const hoseiList = ajiList.map(aji => Math.abs(aji));
  var result = 0;
  const sum = ajiList.reduce((ac, cu) => ac + cu);
  const hoseiRet = Math.min(...hoseiList);
  if (sum >= 0) {
    result = sum - hoseiRet
  } else {
    result = sum + hoseiRet
  }
  console.log(result);
};

// 文字列を数値に変換
function formatNum(str) {
  return Number(str);
};

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