// Slower C++ solution:
#include <bits/stdc++.h>

#define repd(i,a,b) for (int i=(a);i<(b);i++)

#define rep(i,n) repd(i,0,n)

#define int long long

typedef long long ll;

using namespace std;

const int MOD = 1000000007;

const int INF = 1010000000;

const double EPS = 1e-10;

const pair<int,int> fd[] = {make_pair(1,0),make_pair(-1,0),make_pair(0,1),make_pair(0,-1)}; 



vector<int> init(int size){

  vector<int> par(size,-1);

  return par;

}



int root(int x, vector<int>& par){

  if(par[x] < 0){

    return x;

  }else{

    return par[x] = root(par[x],par);

  }

}



bool same(int x, int y, vector<int>& par){

  return root(x, par) == root(y, par);

}



void unite(int x, int y, vector<int>& par){

  x = root(x, par), y = root(y, par);

  if(same(x,y, par))return;

  par[x] += par[y];

  par[y] = x;

}



int size(int x, vector<int>& par){

  return -par[root(x, par)];

}



int pow(int x, int n){

  if(n == 0)return 1;

  if(n % 2 == 0)return pow(x * x % MOD, n/2);

  else return x * pow(x, n-1) % MOD;

}



int n;vector<int> v[110000];int c[110000],ans[110000];pair<int,int> dig[110000];

int cind,ansM;



void f(int ver){

  //cout << "ver : " << ver << endl;

  vector<int> next;

  for(int nver : v[ver]){

    if(ans[nver] != -1)continue;

  //cout << "nver : " << nver << " " << cind << endl;

    next.push_back(nver);

    ans[nver] = c[cind];

    ansM += c[cind];

    cind++;

  }

  for(int nver : next){

    f(nver);

  }

}



signed main(){  

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

  int sum = 0, ans, diff = INF;

  rep(i,n){

    sum += l+i;

  }

  rep(i,n){

    if(diff > abs(sum-l-i-sum)){

      diff = abs(sum-l-i-sum);ans = sum-l-i;

    }

  }

  cout << ans << endl;

}


// Faster C++ solution for the same problem (measured speedup: 3.7861534005249653x):
//#define _GLIBCXX_DEBUG

#include <bits/stdc++.h>

using namespace std;

#define repd(i,a,b) for (int i=(a);i<(b);i++)

#define rep(i,n) repd(i,0,n)

typedef long long ll;

typedef long double lb;

#define int long long

#define double long double

#define endn "\n"

typedef pair<int,int> P;

template<class T> inline bool chmin(T& a, T b){if(a>b){a = b;return 1;}return 0;}

template<class T> inline bool chmax(T& a, T b){if(a<b){a = b;return 1;}return 0;}

const int MOD = 1000000007;

//const int MOD = 998244353;

template<class T> inline int add(T& a, T b, T M = MOD){a=(a+M)%M;b=(b+M)%M;a=(a+b)%M;return a;};

template<class T> inline int mul(T& a, T b, T M = MOD){if(a>=M)a%=M;if(b>=M)b%=M;a*=b;if(a>=M)a%=M;return a;};

const ll INF = 1e16;

const double EPS = 1e-10;

const double PI = 3.141592653589793;

const string abc="abcdefghijklmnopqrstuvwxyz";

const string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";

const pair<int,int> fd[] = {make_pair(1,0),make_pair(-1,0),make_pair(0,1),make_pair(0,-1)}; 



////////////////////////////////////////////////////////////////////

///////////////////////___modpow___////////////////////

ll modpow(ll a,  ll n, const ll &MOD = MOD){

  ll ret = n == 0 ? 1 : modpow(a, n/2, MOD);

  (ret *= ret) %= MOD;

  if(n%2)((ret *= a) %= MOD);

  return ret;

}

///////////////////////___modinv___////////////////////

ll modinv(ll d, const ll &MOD = MOD){

  return modpow(d, MOD-2, MOD);

}

////////////////////////////////////////////////////////////////////



int n,l;

signed main(){

  cin>>n>>l;

  int ans, sum = 0;

  rep(i,n)sum += l+i;

  ans = INF;

  rep(i,n){



    if(abs(ans) > abs(l+i)){

    ans = l+i;

  }

  }

  cout << sum - ans << endl;

}