import java.util.*;

public class Main {
	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}

	public void run() {
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt();
		int L=sc.nextInt();

		int min = 200005;
		int sum = 0;
		int sign = 1;
		for(int i=1; i<=N; i++) {
			if(Math.abs(L+i-1)<min) {
				min = Math.abs(L+i-1);
				sign = L+i-1<0 ? -1 : 1;
			}
			sum += L+i-1;
		}
		System.out.println(sum-min*sign);
		sc.close();
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}

	public void run() {
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt();
		int L=sc.nextInt();

		int min = 200005;
		int sum = 0;
		int sign = 1;
		for(int i=1; i<=N; i++) {
			if(Math.abs(L+i-1)<min) {
				min = Math.abs(L+i-1);
				sign = L+i-1<0 ? -1 : 1;
			}
			sum += L+i-1;
		}
		System.out.println(sum-min*sign);
		sc.close();
	}
} Main public static void main(String[] args) {
		Main main = new Main();
		main.run();
	} main {
		Main main = new Main();
		main.run();
	} Main main = new Main(); main new Main() main.run() main.run main String[] args args public void run() {
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt();
		int L=sc.nextInt();

		int min = 200005;
		int sum = 0;
		int sign = 1;
		for(int i=1; i<=N; i++) {
			if(Math.abs(L+i-1)<min) {
				min = Math.abs(L+i-1);
				sign = L+i-1<0 ? -1 : 1;
			}
			sum += L+i-1;
		}
		System.out.println(sum-min*sign);
		sc.close();
	} run {
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt();
		int L=sc.nextInt();

		int min = 200005;
		int sum = 0;
		int sign = 1;
		for(int i=1; i<=N; i++) {
			if(Math.abs(L+i-1)<min) {
				min = Math.abs(L+i-1);
				sign = L+i-1<0 ? -1 : 1;
			}
			sum += L+i-1;
		}
		System.out.println(sum-min*sign);
		sc.close();
	} 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 int min = 200005; min 200005 int sum = 0; sum 0 int sign = 1; sign 1 for(int i=1; i<=N; i++) {
			if(Math.abs(L+i-1)<min) {
				min = Math.abs(L+i-1);
				sign = L+i-1<0 ? -1 : 1;
			}
			sum += L+i-1;
		} int i=1; int i=1; i 1 i<=N i N i++ i++ i {
			if(Math.abs(L+i-1)<min) {
				min = Math.abs(L+i-1);
				sign = L+i-1<0 ? -1 : 1;
			}
			sum += L+i-1;
		} {
			if(Math.abs(L+i-1)<min) {
				min = Math.abs(L+i-1);
				sign = L+i-1<0 ? -1 : 1;
			}
			sum += L+i-1;
		} if(Math.abs(L+i-1)<min) {
				min = Math.abs(L+i-1);
				sign = L+i-1<0 ? -1 : 1;
			} Math.abs(L+i-1)<min Math.abs(L+i-1) Math.abs Math L+i-1 L+i L i 1 min {
				min = Math.abs(L+i-1);
				sign = L+i-1<0 ? -1 : 1;
			} min = Math.abs(L+i-1) min Math.abs(L+i-1) Math.abs Math L+i-1 L+i L i 1 sign = L+i-1<0 ? -1 : 1 sign L+i-1<0 ? -1 : 1 L+i-1<0 L+i-1 L+i L i 1 0 -1 1 1 sum += L+i-1 sum L+i-1 L+i L i 1 System.out.println(sum-min*sign) System.out.println System.out System System.out sum-min*sign sum min*sign min sign sc.close() sc.close sc public class Main {
	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}

	public void run() {
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt();
		int L=sc.nextInt();

		int min = 200005;
		int sum = 0;
		int sign = 1;
		for(int i=1; i<=N; i++) {
			if(Math.abs(L+i-1)<min) {
				min = Math.abs(L+i-1);
				sign = L+i-1<0 ? -1 : 1;
			}
			sum += L+i-1;
		}
		System.out.println(sum-min*sign);
		sc.close();
	}
} public class Main {
	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}

	public void run() {
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt();
		int L=sc.nextInt();

		int min = 200005;
		int sum = 0;
		int sign = 1;
		for(int i=1; i<=N; i++) {
			if(Math.abs(L+i-1)<min) {
				min = Math.abs(L+i-1);
				sign = L+i-1<0 ? -1 : 1;
			}
			sum += L+i-1;
		}
		System.out.println(sum-min*sign);
		sc.close();
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}

	public void run() {
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt();
		int L=sc.nextInt();

		int min = 200005;
		int sum = 0;
		int sign = 1;
		for(int i=1; i<=N; i++) {
			if(Math.abs(L+i-1)<min) {
				min = Math.abs(L+i-1);
				sign = L+i-1<0 ? -1 : 1;
			}
			sum += L+i-1;
		}
		System.out.println(sum-min*sign);
		sc.close();
	}
}
