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

#ifdef _DEBUG
inline void dump() { cerr << endl; }
template<typename Head> void dump(Head&& head) { cerr << head; dump(); }
template<typename Head, typename... Tail> void dump(Head&& head, Tail&&... tail) { cerr << head << ", "; dump(forward<Tail>(tail)...); }
#define debug(...) do {cerr << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; dump(__VA_ARGS__); } while (false)
#else
#define dump(...)
#define debug(...)
#endif

template<typename T>
struct edge {
  int src, to;
  T cost;
  edge(int to, T cost) : src(-1), to(to), cost(cost) {}
  edge(int src, int to, T cost) : src(src), to(to), cost(cost) {}
  edge &operator=(const int &x) {
    to = x;
    return *this;
  }
  operator int() const { return to; }
};
template<typename T>
using Edges = vector<edge<T>>;
template<typename T>
using WeightedGraph = vector<Edges<T>>;
using UnWeightedGraph = vector<vector<int>>;
template<typename T>
using Matrix = vector<vector<T>>;

/////////////////////////////////////////////////////////////////////
const ll inf = 1LL<<60;

int main()
{
  ll n,l; cin>>n>>l;

  ll sum = n*(n-1)/2 + l*n;

  ll ms = inf;
  for (int i=0; i<n; i++) {
    if (abs(ms) > abs(i+l)) ms = i+l;
  }
  cout << sum - ms << "\n";

  return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main()
{
  int n,l;
  cin >> n >> l;
  
  int a[n];
  int all = 0;
  for(int i = 1; i <= n; i++){
    a[i] = l + i - 1;
    all += a[i];
  }
  
  int minu = 0,maxmin = 2000000;
  for(int i = 1; i <= n; i++){
    for(int j = 1; j <= n; j++){
      if(j != i){
        minu += a[j];
      }//if
    }//for
    if(abs(minu - all) < abs(maxmin - all)){
      maxmin = minu;
    }
    minu = 0;
  }
  
  cout << maxmin << endl;
    
}