#import <stdio.h>

int main(int argc, char *argv[]) {
	int N,S;
	scanf("%d %d",&N,&S);
	int E = S + N - 1;
	int a;
	if (S<0&&E>0) {
		a = (S+E)*N/2;
	}else if (S>=0){
		a = (S+1+E)*(N-1)/2;
	} else {
		a = (S+E-1)*(N-1)/2;
	}
	printf("%d",a);
}