import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int l = scan.nextInt();

		long sum = 0;
		long[] a = new long[n + 1];
		int i;
		for(i = 1; i <= n; i++) {
			long temp = (l + i - 1);
			sum += temp;
			a[i] = temp;
		}
		long min = Long.MAX_VALUE;
		int ans = 0;
		for(i = 1; i <= n; i++) {
			if(Math.abs(sum - (sum - a[i])) < min) {
				min = Math.abs(sum - (sum - a[i]));
				ans = i;
			}
		}

		System.out.println(sum - a[ans]);
	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int l = scan.nextInt();

		long sum = 0;
		long[] a = new long[n + 1];
		int i;
		for(i = 1; i <= n; i++) {
			long temp = (l + i - 1);
			sum += temp;
			a[i] = temp;
		}
		long min = Long.MAX_VALUE;
		int ans = 0;
		for(i = 1; i <= n; i++) {
			if(Math.abs(sum - (sum - a[i])) < min) {
				min = Math.abs(sum - (sum - a[i]));
				ans = i;
			}
		}

		System.out.println(sum - a[ans]);
	}
} Main public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int l = scan.nextInt();

		long sum = 0;
		long[] a = new long[n + 1];
		int i;
		for(i = 1; i <= n; i++) {
			long temp = (l + i - 1);
			sum += temp;
			a[i] = temp;
		}
		long min = Long.MAX_VALUE;
		int ans = 0;
		for(i = 1; i <= n; i++) {
			if(Math.abs(sum - (sum - a[i])) < min) {
				min = Math.abs(sum - (sum - a[i]));
				ans = i;
			}
		}

		System.out.println(sum - a[ans]);
	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int l = scan.nextInt();

		long sum = 0;
		long[] a = new long[n + 1];
		int i;
		for(i = 1; i <= n; i++) {
			long temp = (l + i - 1);
			sum += temp;
			a[i] = temp;
		}
		long min = Long.MAX_VALUE;
		int ans = 0;
		for(i = 1; i <= n; i++) {
			if(Math.abs(sum - (sum - a[i])) < min) {
				min = Math.abs(sum - (sum - a[i]));
				ans = i;
			}
		}

		System.out.println(sum - a[ans]);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int l = scan.nextInt(); l scan.nextInt() scan.nextInt scan long sum = 0; sum 0 long[] a = new long[n + 1]; a new long[n + 1] n + 1 n 1 int i; i for(i = 1; i <= n; i++) {
			long temp = (l + i - 1);
			sum += temp;
			a[i] = temp;
		} i = 1; i = 1 i 1 i <= n i n i++ i++ i {
			long temp = (l + i - 1);
			sum += temp;
			a[i] = temp;
		} {
			long temp = (l + i - 1);
			sum += temp;
			a[i] = temp;
		} long temp = (l + i - 1); temp (l + i - 1) l + i l i 1 sum += temp sum temp a[i] = temp a[i] a i temp long min = Long.MAX_VALUE; min Long.MAX_VALUE Long Long.MAX_VALUE int ans = 0; ans 0 for(i = 1; i <= n; i++) {
			if(Math.abs(sum - (sum - a[i])) < min) {
				min = Math.abs(sum - (sum - a[i]));
				ans = i;
			}
		} i = 1; i = 1 i 1 i <= n i n i++ i++ i {
			if(Math.abs(sum - (sum - a[i])) < min) {
				min = Math.abs(sum - (sum - a[i]));
				ans = i;
			}
		} {
			if(Math.abs(sum - (sum - a[i])) < min) {
				min = Math.abs(sum - (sum - a[i]));
				ans = i;
			}
		} if(Math.abs(sum - (sum - a[i])) < min) {
				min = Math.abs(sum - (sum - a[i]));
				ans = i;
			} Math.abs(sum - (sum - a[i])) < min Math.abs(sum - (sum - a[i])) Math.abs Math sum - (sum - a[i]) sum (sum - a[i]) sum a[i] a i min {
				min = Math.abs(sum - (sum - a[i]));
				ans = i;
			} min = Math.abs(sum - (sum - a[i])) min Math.abs(sum - (sum - a[i])) Math.abs Math sum - (sum - a[i]) sum (sum - a[i]) sum a[i] a i ans = i ans i System.out.println(sum - a[ans]) System.out.println System.out System System.out sum - a[ans] sum a[ans] a ans String[] args args public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int l = scan.nextInt();

		long sum = 0;
		long[] a = new long[n + 1];
		int i;
		for(i = 1; i <= n; i++) {
			long temp = (l + i - 1);
			sum += temp;
			a[i] = temp;
		}
		long min = Long.MAX_VALUE;
		int ans = 0;
		for(i = 1; i <= n; i++) {
			if(Math.abs(sum - (sum - a[i])) < min) {
				min = Math.abs(sum - (sum - a[i]));
				ans = i;
			}
		}

		System.out.println(sum - a[ans]);
	}
} public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int l = scan.nextInt();

		long sum = 0;
		long[] a = new long[n + 1];
		int i;
		for(i = 1; i <= n; i++) {
			long temp = (l + i - 1);
			sum += temp;
			a[i] = temp;
		}
		long min = Long.MAX_VALUE;
		int ans = 0;
		for(i = 1; i <= n; i++) {
			if(Math.abs(sum - (sum - a[i])) < min) {
				min = Math.abs(sum - (sum - a[i]));
				ans = i;
			}
		}

		System.out.println(sum - a[ans]);
	}
} Main
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int l = scan.nextInt();

		long sum = 0;
		long[] a = new long[n + 1];
		int i;
		for(i = 1; i <= n; i++) {
			long temp = (l + i - 1);
			sum += temp;
			a[i] = temp;
		}
		long min = Long.MAX_VALUE;
		int ans = 0;
		for(i = 1; i <= n; i++) {
			if(Math.abs(sum - (sum - a[i])) < min) {
				min = Math.abs(sum - (sum - a[i]));
				ans = i;
			}
		}

		System.out.println(sum - a[ans]);
	}
}
