import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int l = sc.nextInt();
		int sum = l * n;
		int[] aji = new int[n];
		for(int i = 0 ; i < n ; i++) {
			sum += i;
			aji[i] = l + i;
		}
		int min = Integer.MAX_VALUE / 2;
		int aji2 = 0;
		for(int i = 0 ; i < n ; i++) {
			int apple_pie = sum - aji[i];
			int sa = Math.abs(sum - apple_pie);
			if(min > sa) {
				aji2 = apple_pie;
				min = sa;
			}
		}

		sc.close();
		System.out.println(aji2);

	}
}
 import java.util.Scanner; Scanner 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 sum = l * n;
		int[] aji = new int[n];
		for(int i = 0 ; i < n ; i++) {
			sum += i;
			aji[i] = l + i;
		}
		int min = Integer.MAX_VALUE / 2;
		int aji2 = 0;
		for(int i = 0 ; i < n ; i++) {
			int apple_pie = sum - aji[i];
			int sa = Math.abs(sum - apple_pie);
			if(min > sa) {
				aji2 = apple_pie;
				min = sa;
			}
		}

		sc.close();
		System.out.println(aji2);

	}
} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int l = sc.nextInt();
		int sum = l * n;
		int[] aji = new int[n];
		for(int i = 0 ; i < n ; i++) {
			sum += i;
			aji[i] = l + i;
		}
		int min = Integer.MAX_VALUE / 2;
		int aji2 = 0;
		for(int i = 0 ; i < n ; i++) {
			int apple_pie = sum - aji[i];
			int sa = Math.abs(sum - apple_pie);
			if(min > sa) {
				aji2 = apple_pie;
				min = sa;
			}
		}

		sc.close();
		System.out.println(aji2);

	} main {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int l = sc.nextInt();
		int sum = l * n;
		int[] aji = new int[n];
		for(int i = 0 ; i < n ; i++) {
			sum += i;
			aji[i] = l + i;
		}
		int min = Integer.MAX_VALUE / 2;
		int aji2 = 0;
		for(int i = 0 ; i < n ; i++) {
			int apple_pie = sum - aji[i];
			int sa = Math.abs(sum - apple_pie);
			if(min > sa) {
				aji2 = apple_pie;
				min = sa;
			}
		}

		sc.close();
		System.out.println(aji2);

	} 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 sum = l * n; sum l * n l n int[] aji = new int[n]; aji new int[n] n for(int i = 0 ; i < n ; i++) {
			sum += i;
			aji[i] = l + i;
		} int i = 0 ; int i = 0 ; i 0 i < n i n i++ i++ i {
			sum += i;
			aji[i] = l + i;
		} {
			sum += i;
			aji[i] = l + i;
		} sum += i sum i aji[i] = l + i aji[i] aji i l + i l i int min = Integer.MAX_VALUE / 2; min Integer.MAX_VALUE / 2 Integer.MAX_VALUE Integer Integer.MAX_VALUE 2 int aji2 = 0; aji2 0 for(int i = 0 ; i < n ; i++) {
			int apple_pie = sum - aji[i];
			int sa = Math.abs(sum - apple_pie);
			if(min > sa) {
				aji2 = apple_pie;
				min = sa;
			}
		} int i = 0 ; int i = 0 ; i 0 i < n i n i++ i++ i {
			int apple_pie = sum - aji[i];
			int sa = Math.abs(sum - apple_pie);
			if(min > sa) {
				aji2 = apple_pie;
				min = sa;
			}
		} {
			int apple_pie = sum - aji[i];
			int sa = Math.abs(sum - apple_pie);
			if(min > sa) {
				aji2 = apple_pie;
				min = sa;
			}
		} int apple_pie = sum - aji[i]; apple_pie sum - aji[i] sum aji[i] aji i int sa = Math.abs(sum - apple_pie); sa Math.abs(sum - apple_pie) Math.abs Math sum - apple_pie sum apple_pie if(min > sa) {
				aji2 = apple_pie;
				min = sa;
			} min > sa min sa {
				aji2 = apple_pie;
				min = sa;
			} aji2 = apple_pie aji2 apple_pie min = sa min sa sc.close() sc.close sc System.out.println(aji2) System.out.println System.out System System.out aji2 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 sum = l * n;
		int[] aji = new int[n];
		for(int i = 0 ; i < n ; i++) {
			sum += i;
			aji[i] = l + i;
		}
		int min = Integer.MAX_VALUE / 2;
		int aji2 = 0;
		for(int i = 0 ; i < n ; i++) {
			int apple_pie = sum - aji[i];
			int sa = Math.abs(sum - apple_pie);
			if(min > sa) {
				aji2 = apple_pie;
				min = sa;
			}
		}

		sc.close();
		System.out.println(aji2);

	}
} public class Main {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int l = sc.nextInt();
		int sum = l * n;
		int[] aji = new int[n];
		for(int i = 0 ; i < n ; i++) {
			sum += i;
			aji[i] = l + i;
		}
		int min = Integer.MAX_VALUE / 2;
		int aji2 = 0;
		for(int i = 0 ; i < n ; i++) {
			int apple_pie = sum - aji[i];
			int sa = Math.abs(sum - apple_pie);
			if(min > sa) {
				aji2 = apple_pie;
				min = sa;
			}
		}

		sc.close();
		System.out.println(aji2);

	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int l = sc.nextInt();
		int sum = l * n;
		int[] aji = new int[n];
		for(int i = 0 ; i < n ; i++) {
			sum += i;
			aji[i] = l + i;
		}
		int min = Integer.MAX_VALUE / 2;
		int aji2 = 0;
		for(int i = 0 ; i < n ; i++) {
			int apple_pie = sum - aji[i];
			int sa = Math.abs(sum - apple_pie);
			if(min > sa) {
				aji2 = apple_pie;
				min = sa;
			}
		}

		sc.close();
		System.out.println(aji2);

	}
}

