#include<stdio.h>
#include<stdlib.h>
#include<math.h>
void main()
{
	int n,l;
	scanf("%d %d", &n,&l);

	int *apples = malloc(n*sizeof(int));
	
	int sum = 0;

	for(int i=0; i<n; i++)
	{
		apples[i] = l+i;
		sum = sum + apples[i];
	}

	int tempsum = sum - apples[n-1];
	int j=0, index=0;
	for(int i=n-2; i>=0; i--)
	{
		if(tempsum<(abs(sum-apples[i])))
			tempsum = sum - apples[i];
	}
		

	printf("%d", tempsum);

	free(apples);

}
