import java.util.Scanner;

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

		int sum = 0;
		for (int i = 0; i < n; i++) {
			sum += l + i;
		}

		int ans = Integer.MAX_VALUE;
		int idx = -1;
		for (int i = 0; i < n; i++) {
			int val = sum - (l + i);
			val = Math.abs(sum - val);
			if (val < ans) {
				ans = val;
				idx = i;
			}
		}
		System.out.println(sum - (l + idx));
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int l = sc.nextInt();
		sc.close();

		int sum = 0;
		for (int i = 0; i < n; i++) {
			sum += l + i;
		}

		int ans = Integer.MAX_VALUE;
		int idx = -1;
		for (int i = 0; i < n; i++) {
			int val = sum - (l + i);
			val = Math.abs(sum - val);
			if (val < ans) {
				ans = val;
				idx = i;
			}
		}
		System.out.println(sum - (l + idx));
	}
} Main public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int l = sc.nextInt();
		sc.close();

		int sum = 0;
		for (int i = 0; i < n; i++) {
			sum += l + i;
		}

		int ans = Integer.MAX_VALUE;
		int idx = -1;
		for (int i = 0; i < n; i++) {
			int val = sum - (l + i);
			val = Math.abs(sum - val);
			if (val < ans) {
				ans = val;
				idx = i;
			}
		}
		System.out.println(sum - (l + idx));
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int l = sc.nextInt();
		sc.close();

		int sum = 0;
		for (int i = 0; i < n; i++) {
			sum += l + i;
		}

		int ans = Integer.MAX_VALUE;
		int idx = -1;
		for (int i = 0; i < n; i++) {
			int val = sum - (l + i);
			val = Math.abs(sum - val);
			if (val < ans) {
				ans = val;
				idx = i;
			}
		}
		System.out.println(sum - (l + idx));
	} 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 sc.close() sc.close sc int sum = 0; sum 0 for (int i = 0; i < n; i++) {
			sum += l + i;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			sum += l + i;
		} {
			sum += l + i;
		} sum += l + i sum l + i l i int ans = Integer.MAX_VALUE; ans Integer.MAX_VALUE Integer Integer.MAX_VALUE int idx = -1; idx -1 1 for (int i = 0; i < n; i++) {
			int val = sum - (l + i);
			val = Math.abs(sum - val);
			if (val < ans) {
				ans = val;
				idx = i;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			int val = sum - (l + i);
			val = Math.abs(sum - val);
			if (val < ans) {
				ans = val;
				idx = i;
			}
		} {
			int val = sum - (l + i);
			val = Math.abs(sum - val);
			if (val < ans) {
				ans = val;
				idx = i;
			}
		} int val = sum - (l + i); val sum - (l + i) sum (l + i) l i val = Math.abs(sum - val) val Math.abs(sum - val) Math.abs Math sum - val sum val if (val < ans) {
				ans = val;
				idx = i;
			} val < ans val ans {
				ans = val;
				idx = i;
			} ans = val ans val idx = i idx i System.out.println(sum - (l + idx)) System.out.println System.out System System.out sum - (l + idx) sum (l + idx) l idx String[] args args public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int l = sc.nextInt();
		sc.close();

		int sum = 0;
		for (int i = 0; i < n; i++) {
			sum += l + i;
		}

		int ans = Integer.MAX_VALUE;
		int idx = -1;
		for (int i = 0; i < n; i++) {
			int val = sum - (l + i);
			val = Math.abs(sum - val);
			if (val < ans) {
				ans = val;
				idx = i;
			}
		}
		System.out.println(sum - (l + idx));
	}
} public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int l = sc.nextInt();
		sc.close();

		int sum = 0;
		for (int i = 0; i < n; i++) {
			sum += l + i;
		}

		int ans = Integer.MAX_VALUE;
		int idx = -1;
		for (int i = 0; i < n; i++) {
			int val = sum - (l + i);
			val = Math.abs(sum - val);
			if (val < ans) {
				ans = val;
				idx = i;
			}
		}
		System.out.println(sum - (l + idx));
	}
} Main
import java.util.Scanner;

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

		int sum = 0;
		for (int i = 0; i < n; i++) {
			sum += l + i;
		}

		int ans = Integer.MAX_VALUE;
		int idx = -1;
		for (int i = 0; i < n; i++) {
			int val = sum - (l + i);
			val = Math.abs(sum - val);
			if (val < ans) {
				ans = val;
				idx = i;
			}
		}
		System.out.println(sum - (l + idx));
	}
}
