#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	int n,l,ans=1e9; cin>>n>>l;
	int S[n], sum=0;
	for(int i=0; i<n; i++){
		S[i] = l+i+1-1;
		sum+=S[i];
	}
	for(int i=0; i<n; i++){
		int x = abs(sum - (sum-S[i]));
		ans = min(ans, x);
	}
	if(sum>=0)cout<<sum-ans<<endl;
	else cout<<sum+ans<<endl;
}

#include <iostream>
#include <vector>
#include <algorithm>


using namespace std;
int main(){
  int n, l;
  cin >> n >> l;

  int sum = n*(l-1) + (n*(n+1))/2;
  if((l+n-1) < 0) {
    sum -= l+n-1;
  } else if(0 < l) {
    sum -= l;
  }
  cout << sum << endl;
  return 0;
}
