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

int main() {
  double n,l,all;
  cin >> n >> l;
  all=(l+(n-1)*0.5)*n;
  if(l<0&&(0-l)<n) cout << all << endl;
  else if(l<0) cout << all-l-n+1 << endl;
  else cout << all-l << endl;
}