function main(input) {
  const lines = input.split('\n');
  lines.forEach(line => {
    if (line.length === 0) {
      return;
    }
    const vs = line.split(' ');
    console.log(flow(parseInt(vs[0], 10), parseInt(vs[1], 10)));
  });
}

function flow(length, start) {
  var result = 0;
  var minimum = null;
  for(var i = 1; i <= length; i++) {
    var current = start+i-1;
    if (minimum === null) {
      minimum = current;
    }
    if (Math.abs(minimum) > Math.abs(current)) {
      minimum = current;
    }
    result += start+i-1;
  }
  if (minimum === null) {
    minimum = 0;
  }
  return result - minimum;
}

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