import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int L = Integer.parseInt(sc.next());
		int[] Eval = new int[N];
		int sum = 0;
		for(int i = 0;i < N;i++) {
			Eval[i] = L+ i;
			sum += Eval[i];
		}
		sc.close();
		int num = 0;
		if(Eval[0] > 0) {
			num = Eval[0];
		}else if(Eval[N-1] < 0) {
			num = Eval[N-1];
		}else {
			num = 0;
		}
		System.out.println(sum - num);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int L = Integer.parseInt(sc.next());
		int[] Eval = new int[N];
		int sum = 0;
		for(int i = 0;i < N;i++) {
			Eval[i] = L+ i;
			sum += Eval[i];
		}
		sc.close();
		int num = 0;
		if(Eval[0] > 0) {
			num = Eval[0];
		}else if(Eval[N-1] < 0) {
			num = Eval[N-1];
		}else {
			num = 0;
		}
		System.out.println(sum - num);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int L = Integer.parseInt(sc.next());
		int[] Eval = new int[N];
		int sum = 0;
		for(int i = 0;i < N;i++) {
			Eval[i] = L+ i;
			sum += Eval[i];
		}
		sc.close();
		int num = 0;
		if(Eval[0] > 0) {
			num = Eval[0];
		}else if(Eval[N-1] < 0) {
			num = Eval[N-1];
		}else {
			num = 0;
		}
		System.out.println(sum - num);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int L = Integer.parseInt(sc.next());
		int[] Eval = new int[N];
		int sum = 0;
		for(int i = 0;i < N;i++) {
			Eval[i] = L+ i;
			sum += Eval[i];
		}
		sc.close();
		int num = 0;
		if(Eval[0] > 0) {
			num = Eval[0];
		}else if(Eval[N-1] < 0) {
			num = Eval[N-1];
		}else {
			num = 0;
		}
		System.out.println(sum - num);
	} 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[] Eval = new int[N]; Eval new int[N] N int sum = 0; sum 0 for(int i = 0;i < N;i++) {
			Eval[i] = L+ i;
			sum += Eval[i];
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			Eval[i] = L+ i;
			sum += Eval[i];
		} {
			Eval[i] = L+ i;
			sum += Eval[i];
		} Eval[i] = L+ i Eval[i] Eval i L+ i L i sum += Eval[i] sum Eval[i] Eval i sc.close() sc.close sc int num = 0; num 0 if(Eval[0] > 0) {
			num = Eval[0];
		}else if(Eval[N-1] < 0) {
			num = Eval[N-1];
		}else {
			num = 0;
		} Eval[0] > 0 Eval[0] Eval 0 0 {
			num = Eval[0];
		} num = Eval[0] num Eval[0] Eval 0 if(Eval[N-1] < 0) {
			num = Eval[N-1];
		}else {
			num = 0;
		} Eval[N-1] < 0 Eval[N-1] Eval N-1 N 1 0 {
			num = Eval[N-1];
		} num = Eval[N-1] num Eval[N-1] Eval N-1 N 1 {
			num = 0;
		} num = 0 num 0 System.out.println(sum - num) System.out.println System.out System System.out sum - num sum num String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int L = Integer.parseInt(sc.next());
		int[] Eval = new int[N];
		int sum = 0;
		for(int i = 0;i < N;i++) {
			Eval[i] = L+ i;
			sum += Eval[i];
		}
		sc.close();
		int num = 0;
		if(Eval[0] > 0) {
			num = Eval[0];
		}else if(Eval[N-1] < 0) {
			num = Eval[N-1];
		}else {
			num = 0;
		}
		System.out.println(sum - num);
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int L = Integer.parseInt(sc.next());
		int[] Eval = new int[N];
		int sum = 0;
		for(int i = 0;i < N;i++) {
			Eval[i] = L+ i;
			sum += Eval[i];
		}
		sc.close();
		int num = 0;
		if(Eval[0] > 0) {
			num = Eval[0];
		}else if(Eval[N-1] < 0) {
			num = Eval[N-1];
		}else {
			num = 0;
		}
		System.out.println(sum - num);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int L = Integer.parseInt(sc.next());
		int[] Eval = new int[N];
		int sum = 0;
		for(int i = 0;i < N;i++) {
			Eval[i] = L+ i;
			sum += Eval[i];
		}
		sc.close();
		int num = 0;
		if(Eval[0] > 0) {
			num = Eval[0];
		}else if(Eval[N-1] < 0) {
			num = Eval[N-1];
		}else {
			num = 0;
		}
		System.out.println(sum - num);
	}
}