import java.util.Scanner;

public class Main {

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

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

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

public class Main {

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