#include <bits/stdc++.h>
using namespace std;
#include <math.h>
#include <iomanip>
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF=1e9;
const int mod = 1000000007;

int main(){
  int N,L;
  cin>>N>>L;
  int MIN=INF,sum=0;
  for(int i=1;i<=N;i++){
    sum+=L+i-1;
  }
  int ans=0;
  for(int i=1;i<=N;i++){
    int x=sum-(L+i-1);
    if(abs(sum-x)<MIN){MIN=abs(sum-x);ans=x;}
  }
  cout<<ans<<endl;
  return 0;                       
}
#include<bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
template<class T> inline bool chmax(T& a, T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a, T b){if(a>b){a=b;return 1;}return 0;}
#define rep(i,n) for(int i=0;i<n;i++)
#define all(a)  (a).begin(),(a).end()
#define P pair<int, int>
#define ll long long
const int MOD = 1000000007;
//bitset<64>(x).count()
//fixed << setprecision(15) << 

int main(){
  int n, l;
  cin >> n >> l;
  ll ans = (n*(n+2*l-1))/2;
  if(l>=0)
    ans -= l;
  else
    if(n+l-1<0)
      ans -=n+l-1;
  cout << ans << endl;
}
