import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int l = sc.nextInt();
		int[] arr  = new int[n];
		int sum = 0;
		for(int i=1;i<=n;i++) {
			arr[i-1]=l+i-1;
			sum = sum+arr[i-1];
		}
		int min = Integer.MAX_VALUE;
		int y = 0;
		for(int j=0;j<n;j++) {
			if(Math.abs(sum-(sum-arr[j]))<min) {
				min = Math.abs(sum-(sum-arr[j]));
				y=j;
				
			}
		}
		
		System.out.println(sum-arr[y]);

	}

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int l = sc.nextInt();
		int[] arr  = new int[n];
		int sum = 0;
		for(int i=1;i<=n;i++) {
			arr[i-1]=l+i-1;
			sum = sum+arr[i-1];
		}
		int min = Integer.MAX_VALUE;
		int y = 0;
		for(int j=0;j<n;j++) {
			if(Math.abs(sum-(sum-arr[j]))<min) {
				min = Math.abs(sum-(sum-arr[j]));
				y=j;
				
			}
		}
		
		System.out.println(sum-arr[y]);

	}

} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int l = sc.nextInt();
		int[] arr  = new int[n];
		int sum = 0;
		for(int i=1;i<=n;i++) {
			arr[i-1]=l+i-1;
			sum = sum+arr[i-1];
		}
		int min = Integer.MAX_VALUE;
		int y = 0;
		for(int j=0;j<n;j++) {
			if(Math.abs(sum-(sum-arr[j]))<min) {
				min = Math.abs(sum-(sum-arr[j]));
				y=j;
				
			}
		}
		
		System.out.println(sum-arr[y]);

	} main {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int l = sc.nextInt();
		int[] arr  = new int[n];
		int sum = 0;
		for(int i=1;i<=n;i++) {
			arr[i-1]=l+i-1;
			sum = sum+arr[i-1];
		}
		int min = Integer.MAX_VALUE;
		int y = 0;
		for(int j=0;j<n;j++) {
			if(Math.abs(sum-(sum-arr[j]))<min) {
				min = Math.abs(sum-(sum-arr[j]));
				y=j;
				
			}
		}
		
		System.out.println(sum-arr[y]);

	} 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[] arr  = new int[n]; arr new int[n] n int sum = 0; sum 0 for(int i=1;i<=n;i++) {
			arr[i-1]=l+i-1;
			sum = sum+arr[i-1];
		} int i=1; int i=1; i 1 i<=n i n i++ i++ i {
			arr[i-1]=l+i-1;
			sum = sum+arr[i-1];
		} {
			arr[i-1]=l+i-1;
			sum = sum+arr[i-1];
		} arr[i-1]=l+i-1 arr[i-1] arr i-1 i 1 l+i-1 l+i l i 1 sum = sum+arr[i-1] sum sum+arr[i-1] sum arr[i-1] arr i-1 i 1 int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE int y = 0; y 0 for(int j=0;j<n;j++) {
			if(Math.abs(sum-(sum-arr[j]))<min) {
				min = Math.abs(sum-(sum-arr[j]));
				y=j;
				
			}
		} int j=0; int j=0; j 0 j<n j n j++ j++ j {
			if(Math.abs(sum-(sum-arr[j]))<min) {
				min = Math.abs(sum-(sum-arr[j]));
				y=j;
				
			}
		} {
			if(Math.abs(sum-(sum-arr[j]))<min) {
				min = Math.abs(sum-(sum-arr[j]));
				y=j;
				
			}
		} if(Math.abs(sum-(sum-arr[j]))<min) {
				min = Math.abs(sum-(sum-arr[j]));
				y=j;
				
			} Math.abs(sum-(sum-arr[j]))<min Math.abs(sum-(sum-arr[j])) Math.abs Math sum-(sum-arr[j]) sum (sum-arr[j]) sum arr[j] arr j min {
				min = Math.abs(sum-(sum-arr[j]));
				y=j;
				
			} min = Math.abs(sum-(sum-arr[j])) min Math.abs(sum-(sum-arr[j])) Math.abs Math sum-(sum-arr[j]) sum (sum-arr[j]) sum arr[j] arr j y=j y j System.out.println(sum-arr[y]) System.out.println System.out System System.out sum-arr[y] sum arr[y] arr y String[] args args public class Main {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int l = sc.nextInt();
		int[] arr  = new int[n];
		int sum = 0;
		for(int i=1;i<=n;i++) {
			arr[i-1]=l+i-1;
			sum = sum+arr[i-1];
		}
		int min = Integer.MAX_VALUE;
		int y = 0;
		for(int j=0;j<n;j++) {
			if(Math.abs(sum-(sum-arr[j]))<min) {
				min = Math.abs(sum-(sum-arr[j]));
				y=j;
				
			}
		}
		
		System.out.println(sum-arr[y]);

	}

} public class Main {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int l = sc.nextInt();
		int[] arr  = new int[n];
		int sum = 0;
		for(int i=1;i<=n;i++) {
			arr[i-1]=l+i-1;
			sum = sum+arr[i-1];
		}
		int min = Integer.MAX_VALUE;
		int y = 0;
		for(int j=0;j<n;j++) {
			if(Math.abs(sum-(sum-arr[j]))<min) {
				min = Math.abs(sum-(sum-arr[j]));
				y=j;
				
			}
		}
		
		System.out.println(sum-arr[y]);

	}

} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int l = sc.nextInt();
		int[] arr  = new int[n];
		int sum = 0;
		for(int i=1;i<=n;i++) {
			arr[i-1]=l+i-1;
			sum = sum+arr[i-1];
		}
		int min = Integer.MAX_VALUE;
		int y = 0;
		for(int j=0;j<n;j++) {
			if(Math.abs(sum-(sum-arr[j]))<min) {
				min = Math.abs(sum-(sum-arr[j]));
				y=j;
				
			}
		}
		
		System.out.println(sum-arr[y]);

	}

}
