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();
		// N個のリンゴ全てを材料としてできるアップルパイの「味」
		int sum = 0;
		for(int i = 1; i <= N; i++) {
			sum += L + i - 1;
		}
		// System.out.println("sum = " + sum);
		// N - 1個のリンゴを材料としてできるアップルパイの「味」との差
		int min = Integer.MAX_VALUE;
		int r = sum;
		for(int i = 1; i <= N; i++) {
			int apple =  L + i - 1;
			int abs = Math.abs(apple);
			// System.out.println("apple = " + apple + " : " +  (sum - apple));
			if(abs < min) {
				min = abs;
				r = sum - apple;
			}
		}
		// System.out.println("min = " + min);
		System.out.println(r);
	}
} 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();
		// N個のリンゴ全てを材料としてできるアップルパイの「味」
		int sum = 0;
		for(int i = 1; i <= N; i++) {
			sum += L + i - 1;
		}
		// System.out.println("sum = " + sum);
		// N - 1個のリンゴを材料としてできるアップルパイの「味」との差
		int min = Integer.MAX_VALUE;
		int r = sum;
		for(int i = 1; i <= N; i++) {
			int apple =  L + i - 1;
			int abs = Math.abs(apple);
			// System.out.println("apple = " + apple + " : " +  (sum - apple));
			if(abs < min) {
				min = abs;
				r = sum - apple;
			}
		}
		// System.out.println("min = " + min);
		System.out.println(r);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int L = sc.nextInt();
		sc.close();
		// N個のリンゴ全てを材料としてできるアップルパイの「味」
		int sum = 0;
		for(int i = 1; i <= N; i++) {
			sum += L + i - 1;
		}
		// System.out.println("sum = " + sum);
		// N - 1個のリンゴを材料としてできるアップルパイの「味」との差
		int min = Integer.MAX_VALUE;
		int r = sum;
		for(int i = 1; i <= N; i++) {
			int apple =  L + i - 1;
			int abs = Math.abs(apple);
			// System.out.println("apple = " + apple + " : " +  (sum - apple));
			if(abs < min) {
				min = abs;
				r = sum - apple;
			}
		}
		// System.out.println("min = " + min);
		System.out.println(r);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int L = sc.nextInt();
		sc.close();
		// N個のリンゴ全てを材料としてできるアップルパイの「味」
		int sum = 0;
		for(int i = 1; i <= N; i++) {
			sum += L + i - 1;
		}
		// System.out.println("sum = " + sum);
		// N - 1個のリンゴを材料としてできるアップルパイの「味」との差
		int min = Integer.MAX_VALUE;
		int r = sum;
		for(int i = 1; i <= N; i++) {
			int apple =  L + i - 1;
			int abs = Math.abs(apple);
			// System.out.println("apple = " + apple + " : " +  (sum - apple));
			if(abs < min) {
				min = abs;
				r = sum - apple;
			}
		}
		// System.out.println("min = " + min);
		System.out.println(r);
	} 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 = 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 min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE int r = sum; r sum for(int i = 1; i <= N; i++) {
			int apple =  L + i - 1;
			int abs = Math.abs(apple);
			// System.out.println("apple = " + apple + " : " +  (sum - apple));
			if(abs < min) {
				min = abs;
				r = sum - apple;
			}
		} int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
			int apple =  L + i - 1;
			int abs = Math.abs(apple);
			// System.out.println("apple = " + apple + " : " +  (sum - apple));
			if(abs < min) {
				min = abs;
				r = sum - apple;
			}
		} {
			int apple =  L + i - 1;
			int abs = Math.abs(apple);
			// System.out.println("apple = " + apple + " : " +  (sum - apple));
			if(abs < min) {
				min = abs;
				r = sum - apple;
			}
		} int apple =  L + i - 1; apple L + i - 1 L + i L i 1 int abs = Math.abs(apple); abs Math.abs(apple) Math.abs Math apple if(abs < min) {
				min = abs;
				r = sum - apple;
			} abs < min abs min {
				min = abs;
				r = sum - apple;
			} min = abs min abs r = sum - apple r sum - apple sum apple System.out.println(r) System.out.println System.out System System.out r 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();
		// N個のリンゴ全てを材料としてできるアップルパイの「味」
		int sum = 0;
		for(int i = 1; i <= N; i++) {
			sum += L + i - 1;
		}
		// System.out.println("sum = " + sum);
		// N - 1個のリンゴを材料としてできるアップルパイの「味」との差
		int min = Integer.MAX_VALUE;
		int r = sum;
		for(int i = 1; i <= N; i++) {
			int apple =  L + i - 1;
			int abs = Math.abs(apple);
			// System.out.println("apple = " + apple + " : " +  (sum - apple));
			if(abs < min) {
				min = abs;
				r = sum - apple;
			}
		}
		// System.out.println("min = " + min);
		System.out.println(r);
	}
} 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();
		// N個のリンゴ全てを材料としてできるアップルパイの「味」
		int sum = 0;
		for(int i = 1; i <= N; i++) {
			sum += L + i - 1;
		}
		// System.out.println("sum = " + sum);
		// N - 1個のリンゴを材料としてできるアップルパイの「味」との差
		int min = Integer.MAX_VALUE;
		int r = sum;
		for(int i = 1; i <= N; i++) {
			int apple =  L + i - 1;
			int abs = Math.abs(apple);
			// System.out.println("apple = " + apple + " : " +  (sum - apple));
			if(abs < min) {
				min = abs;
				r = sum - apple;
			}
		}
		// System.out.println("min = " + min);
		System.out.println(r);
	}
} 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();
		// N個のリンゴ全てを材料としてできるアップルパイの「味」
		int sum = 0;
		for(int i = 1; i <= N; i++) {
			sum += L + i - 1;
		}
		// System.out.println("sum = " + sum);
		// N - 1個のリンゴを材料としてできるアップルパイの「味」との差
		int min = Integer.MAX_VALUE;
		int r = sum;
		for(int i = 1; i <= N; i++) {
			int apple =  L + i - 1;
			int abs = Math.abs(apple);
			// System.out.println("apple = " + apple + " : " +  (sum - apple));
			if(abs < min) {
				min = abs;
				r = sum - apple;
			}
		}
		// System.out.println("min = " + min);
		System.out.println(r);
	}
}
