import java.util.*;
import static java.lang.System.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] point = new int[n];
		int sum = 0;
		int sa = 0;
		int num = 0;
		for (int i = 0; i < n; i++) {
			point[i] = m + i;
			sum += point[i];
		}
		int min = Integer.MAX_VALUE / 10;
		for (int i = 0; i < n; i++) {
			int eated = sum - point[i];
			sa = Math.abs(sum - eated);
			if (min > sa) {
				num = i;
				min = sa;
			}
			}
		out.println(sum - point[num]);

	}
} import java.util.*; util.* java import static java.lang.System.*; import static java.lang.System.*; import static java.lang.System.*; public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] point = new int[n];
		int sum = 0;
		int sa = 0;
		int num = 0;
		for (int i = 0; i < n; i++) {
			point[i] = m + i;
			sum += point[i];
		}
		int min = Integer.MAX_VALUE / 10;
		for (int i = 0; i < n; i++) {
			int eated = sum - point[i];
			sa = Math.abs(sum - eated);
			if (min > sa) {
				num = i;
				min = sa;
			}
			}
		out.println(sum - point[num]);

	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] point = new int[n];
		int sum = 0;
		int sa = 0;
		int num = 0;
		for (int i = 0; i < n; i++) {
			point[i] = m + i;
			sum += point[i];
		}
		int min = Integer.MAX_VALUE / 10;
		for (int i = 0; i < n; i++) {
			int eated = sum - point[i];
			sa = Math.abs(sum - eated);
			if (min > sa) {
				num = i;
				min = sa;
			}
			}
		out.println(sum - point[num]);

	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] point = new int[n];
		int sum = 0;
		int sa = 0;
		int num = 0;
		for (int i = 0; i < n; i++) {
			point[i] = m + i;
			sum += point[i];
		}
		int min = Integer.MAX_VALUE / 10;
		for (int i = 0; i < n; i++) {
			int eated = sum - point[i];
			sa = Math.abs(sum - eated);
			if (min > sa) {
				num = i;
				min = sa;
			}
			}
		out.println(sum - point[num]);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int m = sc.nextInt(); m sc.nextInt() sc.nextInt sc int[] point = new int[n]; point new int[n] n int sum = 0; sum 0 int sa = 0; sa 0 int num = 0; num 0 for (int i = 0; i < n; i++) {
			point[i] = m + i;
			sum += point[i];
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			point[i] = m + i;
			sum += point[i];
		} {
			point[i] = m + i;
			sum += point[i];
		} point[i] = m + i point[i] point i m + i m i sum += point[i] sum point[i] point i int min = Integer.MAX_VALUE / 10; min Integer.MAX_VALUE / 10 Integer.MAX_VALUE Integer Integer.MAX_VALUE 10 for (int i = 0; i < n; i++) {
			int eated = sum - point[i];
			sa = Math.abs(sum - eated);
			if (min > sa) {
				num = i;
				min = sa;
			}
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			int eated = sum - point[i];
			sa = Math.abs(sum - eated);
			if (min > sa) {
				num = i;
				min = sa;
			}
			} {
			int eated = sum - point[i];
			sa = Math.abs(sum - eated);
			if (min > sa) {
				num = i;
				min = sa;
			}
			} int eated = sum - point[i]; eated sum - point[i] sum point[i] point i sa = Math.abs(sum - eated) sa Math.abs(sum - eated) Math.abs Math sum - eated sum eated if (min > sa) {
				num = i;
				min = sa;
			} min > sa min sa {
				num = i;
				min = sa;
			} num = i num i min = sa min sa out.println(sum - point[num]) out.println out sum - point[num] sum point[num] point num String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] point = new int[n];
		int sum = 0;
		int sa = 0;
		int num = 0;
		for (int i = 0; i < n; i++) {
			point[i] = m + i;
			sum += point[i];
		}
		int min = Integer.MAX_VALUE / 10;
		for (int i = 0; i < n; i++) {
			int eated = sum - point[i];
			sa = Math.abs(sum - eated);
			if (min > sa) {
				num = i;
				min = sa;
			}
			}
		out.println(sum - point[num]);

	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] point = new int[n];
		int sum = 0;
		int sa = 0;
		int num = 0;
		for (int i = 0; i < n; i++) {
			point[i] = m + i;
			sum += point[i];
		}
		int min = Integer.MAX_VALUE / 10;
		for (int i = 0; i < n; i++) {
			int eated = sum - point[i];
			sa = Math.abs(sum - eated);
			if (min > sa) {
				num = i;
				min = sa;
			}
			}
		out.println(sum - point[num]);

	}
} Main
import java.util.*;
import static java.lang.System.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] point = new int[n];
		int sum = 0;
		int sa = 0;
		int num = 0;
		for (int i = 0; i < n; i++) {
			point[i] = m + i;
			sum += point[i];
		}
		int min = Integer.MAX_VALUE / 10;
		for (int i = 0; i < n; i++) {
			int eated = sum - point[i];
			sa = Math.abs(sum - eated);
			if (min > sa) {
				num = i;
				min = sa;
			}
			}
		out.println(sum - point[num]);

	}
}