const input = require("fs").readFileSync("/dev/stdin", "utf8");

const data = input.split('\n')[0].split(' ');
const N = +data[0];
const L = +data[1];

const total = (n) => {
  return Array(n).fill(null).reduce((sum, _, i) => sum + i, 0);
};

const value = (n, l, remove) => {
  return l * (n - 1) + total(n) - remove;
};

if (L >= 0) {
  console.log(value(N, L, 0));
} else if(-L > N) {
  console.log(value(N, L, N - 1));
} else {
  console.log(value(N, L, -L));
}
