#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;
}

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <iomanip>

using namespace std;

int main() {
	int N, L;
	cin >> N >> L;
	int applepie = 0;
	for (int i = 1; i <= N; i++) {
		applepie += L + i - 1;
	}
	int ans;
	int diff = abs(L + 1 - 1);
	for (int i = 2; i <= N; i++) {
		diff = min(diff, abs(L + i - 1));
	}
	for (int i = 1; i <= N; i++) {
		if (abs(L + i - 1) == diff) ans = applepie - (L + i - 1);
	}
	cout << ans << endl;
	return 0;
}