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);

    int taste(int i) {
        return L + i - 1;
    }

    int sum = 0;
    for (int i = 1; i <= N; i++) {
        sum += taste(i);
    }

    int ans = 0;
    int best = int.max;
    for (int i = 1; i <= N; i++) {
        int s = 0;
        for (int j = 1; j <= N; j++) {
            if (i == j) continue;
            s += taste(j);
        }

        if (abs(sum - s) < best) {
            best = abs(sum - s);
            ans = s;
        }
    }
    writeln(ans);
}
