import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Solve s= new Solve();
		s.solve();
	}

}
class Solve{
	 Scanner sc = new Scanner(System.in) ;

	 void solve() {
	 int N=sc.nextInt();
	 int L=sc.nextInt();
	 int sum=0;
	 int res=100000000;
	 int[] app=new int[N];
	 
	 for(int i=0;i<N;i++) {
		 app[i]=L+i;
		 sum+=app[i];
	 }
	 for(int i=0;i<N;i++) {
		 int judge=sum-app[i];
		 if(Math.abs(sum-judge)<Math.abs(sum-res)) {
			 res=judge;
		 }
	 }
	 System.out.println(res);
	 }
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Solve s= new Solve();
		s.solve();
	}

} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Solve s= new Solve();
		s.solve();
	} main {
		// TODO 自動生成されたメソッド・スタブ
		Solve s= new Solve();
		s.solve();
	} Solve s= new Solve(); s new Solve() s.solve() s.solve s String[] args args class Solve{
	 Scanner sc = new Scanner(System.in) ;

	 void solve() {
	 int N=sc.nextInt();
	 int L=sc.nextInt();
	 int sum=0;
	 int res=100000000;
	 int[] app=new int[N];
	 
	 for(int i=0;i<N;i++) {
		 app[i]=L+i;
		 sum+=app[i];
	 }
	 for(int i=0;i<N;i++) {
		 int judge=sum-app[i];
		 if(Math.abs(sum-judge)<Math.abs(sum-res)) {
			 res=judge;
		 }
	 }
	 System.out.println(res);
	 }
} Solve Scanner sc = new Scanner(System.in) ; sc new Scanner(System.in) void solve() {
	 int N=sc.nextInt();
	 int L=sc.nextInt();
	 int sum=0;
	 int res=100000000;
	 int[] app=new int[N];
	 
	 for(int i=0;i<N;i++) {
		 app[i]=L+i;
		 sum+=app[i];
	 }
	 for(int i=0;i<N;i++) {
		 int judge=sum-app[i];
		 if(Math.abs(sum-judge)<Math.abs(sum-res)) {
			 res=judge;
		 }
	 }
	 System.out.println(res);
	 } solve {
	 int N=sc.nextInt();
	 int L=sc.nextInt();
	 int sum=0;
	 int res=100000000;
	 int[] app=new int[N];
	 
	 for(int i=0;i<N;i++) {
		 app[i]=L+i;
		 sum+=app[i];
	 }
	 for(int i=0;i<N;i++) {
		 int judge=sum-app[i];
		 if(Math.abs(sum-judge)<Math.abs(sum-res)) {
			 res=judge;
		 }
	 }
	 System.out.println(res);
	 } int N=sc.nextInt(); N sc.nextInt() sc.nextInt sc int L=sc.nextInt(); L sc.nextInt() sc.nextInt sc int sum=0; sum 0 int res=100000000; res 100000000 int[] app=new int[N]; app new int[N] N for(int i=0;i<N;i++) {
		 app[i]=L+i;
		 sum+=app[i];
	 } int i=0; int i=0; i 0 i<N i N i++ i++ i {
		 app[i]=L+i;
		 sum+=app[i];
	 } {
		 app[i]=L+i;
		 sum+=app[i];
	 } app[i]=L+i app[i] app i L+i L i sum+=app[i] sum app[i] app i for(int i=0;i<N;i++) {
		 int judge=sum-app[i];
		 if(Math.abs(sum-judge)<Math.abs(sum-res)) {
			 res=judge;
		 }
	 } int i=0; int i=0; i 0 i<N i N i++ i++ i {
		 int judge=sum-app[i];
		 if(Math.abs(sum-judge)<Math.abs(sum-res)) {
			 res=judge;
		 }
	 } {
		 int judge=sum-app[i];
		 if(Math.abs(sum-judge)<Math.abs(sum-res)) {
			 res=judge;
		 }
	 } int judge=sum-app[i]; judge sum-app[i] sum app[i] app i if(Math.abs(sum-judge)<Math.abs(sum-res)) {
			 res=judge;
		 } Math.abs(sum-judge)<Math.abs(sum-res) Math.abs(sum-judge) Math.abs Math sum-judge sum judge Math.abs(sum-res) Math.abs Math sum-res sum res {
			 res=judge;
		 } res=judge res judge System.out.println(res) System.out.println System.out System System.out res public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Solve s= new Solve();
		s.solve();
	}

} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Solve s= new Solve();
		s.solve();
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Solve s= new Solve();
		s.solve();
	}

}
class Solve{
	 Scanner sc = new Scanner(System.in) ;

	 void solve() {
	 int N=sc.nextInt();
	 int L=sc.nextInt();
	 int sum=0;
	 int res=100000000;
	 int[] app=new int[N];
	 
	 for(int i=0;i<N;i++) {
		 app[i]=L+i;
		 sum+=app[i];
	 }
	 for(int i=0;i<N;i++) {
		 int judge=sum-app[i];
		 if(Math.abs(sum-judge)<Math.abs(sum-res)) {
			 res=judge;
		 }
	 }
	 System.out.println(res);
	 }
}