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();
		sc.close();
		int l = L;

		int a = 0;
		for (int i = 0; i < N; i++) {
			a += L;
			L++;
		}

		int min = 99999;
		int ans = 0;
		for (int i = 0; i < N; i++) {
			int b = a;
			b -= l;
			int c = Math.abs(a - b);
			if (min > c) {
				min = c;
				ans = l;
			}
			l++;
		}
		int ans2 = a - ans;
		System.out.println(ans2);
	}
} 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();
		sc.close();
		int l = L;

		int a = 0;
		for (int i = 0; i < N; i++) {
			a += L;
			L++;
		}

		int min = 99999;
		int ans = 0;
		for (int i = 0; i < N; i++) {
			int b = a;
			b -= l;
			int c = Math.abs(a - b);
			if (min > c) {
				min = c;
				ans = l;
			}
			l++;
		}
		int ans2 = a - ans;
		System.out.println(ans2);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int L = sc.nextInt();
		sc.close();
		int l = L;

		int a = 0;
		for (int i = 0; i < N; i++) {
			a += L;
			L++;
		}

		int min = 99999;
		int ans = 0;
		for (int i = 0; i < N; i++) {
			int b = a;
			b -= l;
			int c = Math.abs(a - b);
			if (min > c) {
				min = c;
				ans = l;
			}
			l++;
		}
		int ans2 = a - ans;
		System.out.println(ans2);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int L = sc.nextInt();
		sc.close();
		int l = L;

		int a = 0;
		for (int i = 0; i < N; i++) {
			a += L;
			L++;
		}

		int min = 99999;
		int ans = 0;
		for (int i = 0; i < N; i++) {
			int b = a;
			b -= l;
			int c = Math.abs(a - b);
			if (min > c) {
				min = c;
				ans = l;
			}
			l++;
		}
		int ans2 = a - ans;
		System.out.println(ans2);
	} 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 l = L; l L int a = 0; a 0 for (int i = 0; i < N; i++) {
			a += L;
			L++;
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			a += L;
			L++;
		} {
			a += L;
			L++;
		} a += L a L L++ L int min = 99999; min 99999 int ans = 0; ans 0 for (int i = 0; i < N; i++) {
			int b = a;
			b -= l;
			int c = Math.abs(a - b);
			if (min > c) {
				min = c;
				ans = l;
			}
			l++;
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			int b = a;
			b -= l;
			int c = Math.abs(a - b);
			if (min > c) {
				min = c;
				ans = l;
			}
			l++;
		} {
			int b = a;
			b -= l;
			int c = Math.abs(a - b);
			if (min > c) {
				min = c;
				ans = l;
			}
			l++;
		} int b = a; b a b -= l b l int c = Math.abs(a - b); c Math.abs(a - b) Math.abs Math a - b a b if (min > c) {
				min = c;
				ans = l;
			} min > c min c {
				min = c;
				ans = l;
			} min = c min c ans = l ans l l++ l int ans2 = a - ans; ans2 a - ans a ans System.out.println(ans2) System.out.println System.out System System.out ans2 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();
		sc.close();
		int l = L;

		int a = 0;
		for (int i = 0; i < N; i++) {
			a += L;
			L++;
		}

		int min = 99999;
		int ans = 0;
		for (int i = 0; i < N; i++) {
			int b = a;
			b -= l;
			int c = Math.abs(a - b);
			if (min > c) {
				min = c;
				ans = l;
			}
			l++;
		}
		int ans2 = a - ans;
		System.out.println(ans2);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int L = sc.nextInt();
		sc.close();
		int l = L;

		int a = 0;
		for (int i = 0; i < N; i++) {
			a += L;
			L++;
		}

		int min = 99999;
		int ans = 0;
		for (int i = 0; i < N; i++) {
			int b = a;
			b -= l;
			int c = Math.abs(a - b);
			if (min > c) {
				min = c;
				ans = l;
			}
			l++;
		}
		int ans2 = a - ans;
		System.out.println(ans2);
	}
} 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();
		sc.close();
		int l = L;

		int a = 0;
		for (int i = 0; i < N; i++) {
			a += L;
			L++;
		}

		int min = 99999;
		int ans = 0;
		for (int i = 0; i < N; i++) {
			int b = a;
			b -= l;
			int c = Math.abs(a - b);
			if (min > c) {
				min = c;
				ans = l;
			}
			l++;
		}
		int ans2 = a - ans;
		System.out.println(ans2);
	}
}
