import std.algorithm;
import std.array;
import std.container;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void scan(T...)(ref T a) {
    string[] ss = readln.split;
    foreach (i, t; T) a[i] = ss[i].to!t;
}
T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

void main() {
    int N, L; scan(N, L);

    // N 個のリングのおいしさは、L, L + 1, L + 2, ..., L + N - 1
    int t = iota(L, L + N).reduce!((a, b) => abs(a) <= abs(b) ? a : b);
    int ans = iota(L, L + N).sum - t;
    writeln(ans);
}
