"use strict"

const main = (input) => {
    input = input.split(" ");
    const N = Number(input[0]);
    const L = Number(input[1]);
    const tastes = [];

    for (let i = 1; i <= N; i++) {
        const taste = L + i - 1;
        tastes.push(taste);
    }

    let plusTastes = 0;
    let minusTastes = 0;
    for (const taste of tastes) {
        if (taste > 0) {
            plusTastes += 1;
        } else {
            minusTastes += 1;
        }
    }

    const allTastes = tastes.reduce((sum, taste) => sum + taste);

    if (allTastes === 0) {
        console.log(0);
    } else {
        if (plusTastes > minusTastes) {
            const ans = allTastes - Math.min(...tastes);
            console.log(ans);
        } else {
            const ans = allTastes - Math.max(...tastes);
            console.log(ans);
        }
    }
}

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