import std.stdio, std.math, std.algorithm, std.array, std.string, std.conv, std.container, std.range;
T Read(T)() { return readln.chomp.to!(T); }
T[] Reads(T)() { return readln.split.to!(T[]); }
alias read = Read!(int);
alias reads = Reads!(int);


void main() {
    int n, l;
    readf("%d %d\n",&n,&l);
    auto aji = new int[n];
    foreach (i; 0..n) aji[i] = l + i;
    int mini = 1<<29;
    int ans;
    int sm = aji.sum();
    foreach (i; 0..n) {
        int x = sm - aji[i];
        int d = abs(x - sm);
        if (d < mini) {
            mini = d;
            ans = x;
        }
    }
    writeln(ans);
}