#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
using P = pair<int, int>;

int main() {

    int n, l;
    cin >> n >> l;

    int r = n + l - 1;

    int eat;

    if (r <= 0) eat = r;
    else if (l >= 0) eat = l;
    else eat = 0;

    cout << (r + l) * (r- l + 1) / 2 - eat << endl;

    return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); i++)
using P = pair<int, int>;
using ll = long long;
const int INF = 1001001001;

int main() {
    int n, l; cin >> n >> l;
    int a[n];
    int sum0 = 0;
    rep(i, n){
        a[i] = i+l;
        sum0 += a[i];
    }
    int s = INF;
    bool minus = false;
    rep(i, n){
        if(s > abs(a[i])){
            if(a[i] < 0) minus = true;
            else minus = false;
            s = abs(a[i]);
        }
        s = min(s, abs(a[i]));
    }
    cout << (!minus? sum0-s: sum0+s) << endl;


    return 0;
}