import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt();
		int L=sc.nextInt();
		int ans=0;
		if(0<=L){ans=(2*L+N)*(N-1)/2;}
		if(0>=L+N-1){ans=(2*L+N-2)*(N-1)/2;}
		if(L<= 0 &&  0<=L+N-1){ans=(2*L+N-1)*(N)/2;}
		
		System.out.println(ans);

	
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt();
		int L=sc.nextInt();
		int ans=0;
		if(0<=L){ans=(2*L+N)*(N-1)/2;}
		if(0>=L+N-1){ans=(2*L+N-2)*(N-1)/2;}
		if(L<= 0 &&  0<=L+N-1){ans=(2*L+N-1)*(N)/2;}
		
		System.out.println(ans);

	
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt();
		int L=sc.nextInt();
		int ans=0;
		if(0<=L){ans=(2*L+N)*(N-1)/2;}
		if(0>=L+N-1){ans=(2*L+N-2)*(N-1)/2;}
		if(L<= 0 &&  0<=L+N-1){ans=(2*L+N-1)*(N)/2;}
		
		System.out.println(ans);

	
	} main {
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt();
		int L=sc.nextInt();
		int ans=0;
		if(0<=L){ans=(2*L+N)*(N-1)/2;}
		if(0>=L+N-1){ans=(2*L+N-2)*(N-1)/2;}
		if(L<= 0 &&  0<=L+N-1){ans=(2*L+N-1)*(N)/2;}
		
		System.out.println(ans);

	
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N=sc.nextInt(); N sc.nextInt() sc.nextInt sc int L=sc.nextInt(); L sc.nextInt() sc.nextInt sc int ans=0; ans 0 if(0<=L){ans=(2*L+N)*(N-1)/2;} 0<=L 0 L {ans=(2*L+N)*(N-1)/2;} ans=(2*L+N)*(N-1)/2 ans (2*L+N)*(N-1)/2 (2*L+N)*(N-1) (2*L+N) 2*L 2 L N (N-1) N 1 2 if(0>=L+N-1){ans=(2*L+N-2)*(N-1)/2;} 0>=L+N-1 0 L+N-1 L+N L N 1 {ans=(2*L+N-2)*(N-1)/2;} ans=(2*L+N-2)*(N-1)/2 ans (2*L+N-2)*(N-1)/2 (2*L+N-2)*(N-1) (2*L+N-2) 2*L+N 2*L 2 L N 2 (N-1) N 1 2 if(L<= 0 &&  0<=L+N-1){ans=(2*L+N-1)*(N)/2;} L<= 0 &&  0<=L+N-1 L<= 0 L 0 0<=L+N-1 0 L+N-1 L+N L N 1 {ans=(2*L+N-1)*(N)/2;} ans=(2*L+N-1)*(N)/2 ans (2*L+N-1)*(N)/2 (2*L+N-1)*(N) (2*L+N-1) 2*L+N 2*L 2 L N 1 (N) 2 System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt();
		int L=sc.nextInt();
		int ans=0;
		if(0<=L){ans=(2*L+N)*(N-1)/2;}
		if(0>=L+N-1){ans=(2*L+N-2)*(N-1)/2;}
		if(L<= 0 &&  0<=L+N-1){ans=(2*L+N-1)*(N)/2;}
		
		System.out.println(ans);

	
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt();
		int L=sc.nextInt();
		int ans=0;
		if(0<=L){ans=(2*L+N)*(N-1)/2;}
		if(0>=L+N-1){ans=(2*L+N-2)*(N-1)/2;}
		if(L<= 0 &&  0<=L+N-1){ans=(2*L+N-1)*(N)/2;}
		
		System.out.println(ans);

	
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt();
		int L=sc.nextInt();
		int ans=0;
		if(0<=L){ans=(2*L+N)*(N-1)/2;}
		if(0>=L+N-1){ans=(2*L+N-2)*(N-1)/2;}
		if(L<= 0 &&  0<=L+N-1){ans=(2*L+N-1)*(N)/2;}
		
		System.out.println(ans);

	
	}
}