#include<stdio.h>
int main(void){
  char *s="python3 -c\""
"n,l=map(int,input().split())\n"
"t=a=0\n"
"m=1e9\n"
"for i in range(n):\n"
"    if abs(l+i)<m:\n"
"        m=abs(l+i)\n"
"        t=l+i\n"
"    a+=l+i\n"
"print(a-t)\n"
"\"";
  system(s);
  return 0;
}            