import java.util.*;
class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int l=sc.nextInt();
		int sum1=0,sum2=0;
		int[] a=new int[n+1];
		for(int i=1;i<=n;i++){
			for(int j=1;j<=n;j++){
				sum1+=l+j-1;
				if(j!=i)
				sum2+=l+j-1;
			}
			a[i]=sum1-sum2;
			if(a[i]<0)
			a[i]=-a[i];
			sum1=0;
			sum2=0;
		}
		int min=a[1];
		for(int i=1;i<=n;i++){
			if(min>a[i])
				min=a[i];
		}
		
		for(int i=1;i<=n;i++){
			if(min==a[i])
				for(int j=1;j<=n;j++){
					if(j!=i)
					sum2+=l+j-1;
				}
		}
		System.out.println(sum2);
		
	}
} import java.util.*; util.* java class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int l=sc.nextInt();
		int sum1=0,sum2=0;
		int[] a=new int[n+1];
		for(int i=1;i<=n;i++){
			for(int j=1;j<=n;j++){
				sum1+=l+j-1;
				if(j!=i)
				sum2+=l+j-1;
			}
			a[i]=sum1-sum2;
			if(a[i]<0)
			a[i]=-a[i];
			sum1=0;
			sum2=0;
		}
		int min=a[1];
		for(int i=1;i<=n;i++){
			if(min>a[i])
				min=a[i];
		}
		
		for(int i=1;i<=n;i++){
			if(min==a[i])
				for(int j=1;j<=n;j++){
					if(j!=i)
					sum2+=l+j-1;
				}
		}
		System.out.println(sum2);
		
	}
} Main public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int l=sc.nextInt();
		int sum1=0,sum2=0;
		int[] a=new int[n+1];
		for(int i=1;i<=n;i++){
			for(int j=1;j<=n;j++){
				sum1+=l+j-1;
				if(j!=i)
				sum2+=l+j-1;
			}
			a[i]=sum1-sum2;
			if(a[i]<0)
			a[i]=-a[i];
			sum1=0;
			sum2=0;
		}
		int min=a[1];
		for(int i=1;i<=n;i++){
			if(min>a[i])
				min=a[i];
		}
		
		for(int i=1;i<=n;i++){
			if(min==a[i])
				for(int j=1;j<=n;j++){
					if(j!=i)
					sum2+=l+j-1;
				}
		}
		System.out.println(sum2);
		
	} main {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int l=sc.nextInt();
		int sum1=0,sum2=0;
		int[] a=new int[n+1];
		for(int i=1;i<=n;i++){
			for(int j=1;j<=n;j++){
				sum1+=l+j-1;
				if(j!=i)
				sum2+=l+j-1;
			}
			a[i]=sum1-sum2;
			if(a[i]<0)
			a[i]=-a[i];
			sum1=0;
			sum2=0;
		}
		int min=a[1];
		for(int i=1;i<=n;i++){
			if(min>a[i])
				min=a[i];
		}
		
		for(int i=1;i<=n;i++){
			if(min==a[i])
				for(int j=1;j<=n;j++){
					if(j!=i)
					sum2+=l+j-1;
				}
		}
		System.out.println(sum2);
		
	} 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 sum1=0 sum1 0 sum2=0; sum2 0 int[] a=new int[n+1]; a new int[n+1] n+1 n 1 for(int i=1;i<=n;i++){
			for(int j=1;j<=n;j++){
				sum1+=l+j-1;
				if(j!=i)
				sum2+=l+j-1;
			}
			a[i]=sum1-sum2;
			if(a[i]<0)
			a[i]=-a[i];
			sum1=0;
			sum2=0;
		} int i=1; int i=1; i 1 i<=n i n i++ i++ i {
			for(int j=1;j<=n;j++){
				sum1+=l+j-1;
				if(j!=i)
				sum2+=l+j-1;
			}
			a[i]=sum1-sum2;
			if(a[i]<0)
			a[i]=-a[i];
			sum1=0;
			sum2=0;
		} {
			for(int j=1;j<=n;j++){
				sum1+=l+j-1;
				if(j!=i)
				sum2+=l+j-1;
			}
			a[i]=sum1-sum2;
			if(a[i]<0)
			a[i]=-a[i];
			sum1=0;
			sum2=0;
		} for(int j=1;j<=n;j++){
				sum1+=l+j-1;
				if(j!=i)
				sum2+=l+j-1;
			} int j=1; int j=1; j 1 j<=n j n j++ j++ j {
				sum1+=l+j-1;
				if(j!=i)
				sum2+=l+j-1;
			} {
				sum1+=l+j-1;
				if(j!=i)
				sum2+=l+j-1;
			} sum1+=l+j-1 sum1 l+j-1 l+j l j 1 if(j!=i)
				sum2+=l+j-1; j!=i j i sum2+=l+j-1 sum2 l+j-1 l+j l j 1 a[i]=sum1-sum2 a[i] a i sum1-sum2 sum1 sum2 if(a[i]<0)
			a[i]=-a[i]; a[i]<0 a[i] a i 0 a[i]=-a[i] a[i] a i -a[i] a[i] a i sum1=0 sum1 0 sum2=0 sum2 0 int min=a[1]; min a[1] a 1 for(int i=1;i<=n;i++){
			if(min>a[i])
				min=a[i];
		} int i=1; int i=1; i 1 i<=n i n i++ i++ i {
			if(min>a[i])
				min=a[i];
		} {
			if(min>a[i])
				min=a[i];
		} if(min>a[i])
				min=a[i]; min>a[i] min a[i] a i min=a[i] min a[i] a i for(int i=1;i<=n;i++){
			if(min==a[i])
				for(int j=1;j<=n;j++){
					if(j!=i)
					sum2+=l+j-1;
				}
		} int i=1; int i=1; i 1 i<=n i n i++ i++ i {
			if(min==a[i])
				for(int j=1;j<=n;j++){
					if(j!=i)
					sum2+=l+j-1;
				}
		} {
			if(min==a[i])
				for(int j=1;j<=n;j++){
					if(j!=i)
					sum2+=l+j-1;
				}
		} if(min==a[i])
				for(int j=1;j<=n;j++){
					if(j!=i)
					sum2+=l+j-1;
				} min==a[i] min a[i] a i for(int j=1;j<=n;j++){
					if(j!=i)
					sum2+=l+j-1;
				} int j=1; int j=1; j 1 j<=n j n j++ j++ j {
					if(j!=i)
					sum2+=l+j-1;
				} {
					if(j!=i)
					sum2+=l+j-1;
				} if(j!=i)
					sum2+=l+j-1; j!=i j i sum2+=l+j-1 sum2 l+j-1 l+j l j 1 System.out.println(sum2) System.out.println System.out System System.out sum2 String[] args args
import java.util.*;
class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int l=sc.nextInt();
		int sum1=0,sum2=0;
		int[] a=new int[n+1];
		for(int i=1;i<=n;i++){
			for(int j=1;j<=n;j++){
				sum1+=l+j-1;
				if(j!=i)
				sum2+=l+j-1;
			}
			a[i]=sum1-sum2;
			if(a[i]<0)
			a[i]=-a[i];
			sum1=0;
			sum2=0;
		}
		int min=a[1];
		for(int i=1;i<=n;i++){
			if(min>a[i])
				min=a[i];
		}
		
		for(int i=1;i<=n;i++){
			if(min==a[i])
				for(int j=1;j<=n;j++){
					if(j!=i)
					sum2+=l+j-1;
				}
		}
		System.out.println(sum2);
		
	}
}
