import 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();
        int a[] = new int[n];
        boolean zero = false;
        int ans = 0;
        for(int i = 0; i < n;i++){
			a[i] = i + l;
          if(a[i] == 0){
            zero = true;
          }
            ans += a[i];
        }
        if(zero){
        }else if(l > 0){
          ans -= a[0];
        }else{
          ans -= a[n - 1];
        }
      	System.out.println(ans);
 
    }
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
        int n = sc.nextInt();
        int l = sc.nextInt();
        int a[] = new int[n];
        boolean zero = false;
        int ans = 0;
        for(int i = 0; i < n;i++){
			a[i] = i + l;
          if(a[i] == 0){
            zero = true;
          }
            ans += a[i];
        }
        if(zero){
        }else if(l > 0){
          ans -= a[0];
        }else{
          ans -= a[n - 1];
        }
      	System.out.println(ans);
 
    }
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
        int n = sc.nextInt();
        int l = sc.nextInt();
        int a[] = new int[n];
        boolean zero = false;
        int ans = 0;
        for(int i = 0; i < n;i++){
			a[i] = i + l;
          if(a[i] == 0){
            zero = true;
          }
            ans += a[i];
        }
        if(zero){
        }else if(l > 0){
          ans -= a[0];
        }else{
          ans -= a[n - 1];
        }
      	System.out.println(ans);
 
    } main {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
        int n = sc.nextInt();
        int l = sc.nextInt();
        int a[] = new int[n];
        boolean zero = false;
        int ans = 0;
        for(int i = 0; i < n;i++){
			a[i] = i + l;
          if(a[i] == 0){
            zero = true;
          }
            ans += a[i];
        }
        if(zero){
        }else if(l > 0){
          ans -= a[0];
        }else{
          ans -= a[n - 1];
        }
      	System.out.println(ans);
 
    } 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 a[] = new int[n]; a new int[n] n boolean zero = false; zero false int ans = 0; ans 0 for(int i = 0; i < n;i++){
			a[i] = i + l;
          if(a[i] == 0){
            zero = true;
          }
            ans += a[i];
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			a[i] = i + l;
          if(a[i] == 0){
            zero = true;
          }
            ans += a[i];
        } {
			a[i] = i + l;
          if(a[i] == 0){
            zero = true;
          }
            ans += a[i];
        } a[i] = i + l a[i] a i i + l i l if(a[i] == 0){
            zero = true;
          } a[i] == 0 a[i] a i 0 {
            zero = true;
          } zero = true zero true ans += a[i] ans a[i] a i if(zero){
        }else if(l > 0){
          ans -= a[0];
        }else{
          ans -= a[n - 1];
        } zero {
        } if(l > 0){
          ans -= a[0];
        }else{
          ans -= a[n - 1];
        } l > 0 l 0 {
          ans -= a[0];
        } ans -= a[0] ans a[0] a 0 {
          ans -= a[n - 1];
        } ans -= a[n - 1] ans a[n - 1] a n - 1 n 1 System.out.println(ans) System.out.println System.out System System.out ans 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();
        int a[] = new int[n];
        boolean zero = false;
        int ans = 0;
        for(int i = 0; i < n;i++){
			a[i] = i + l;
          if(a[i] == 0){
            zero = true;
          }
            ans += a[i];
        }
        if(zero){
        }else if(l > 0){
          ans -= a[0];
        }else{
          ans -= a[n - 1];
        }
      	System.out.println(ans);
 
    }
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
        int n = sc.nextInt();
        int l = sc.nextInt();
        int a[] = new int[n];
        boolean zero = false;
        int ans = 0;
        for(int i = 0; i < n;i++){
			a[i] = i + l;
          if(a[i] == 0){
            zero = true;
          }
            ans += a[i];
        }
        if(zero){
        }else if(l > 0){
          ans -= a[0];
        }else{
          ans -= a[n - 1];
        }
      	System.out.println(ans);
 
    }
} Main
import 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();
        int a[] = new int[n];
        boolean zero = false;
        int ans = 0;
        for(int i = 0; i < n;i++){
			a[i] = i + l;
          if(a[i] == 0){
            zero = true;
          }
            ans += a[i];
        }
        if(zero){
        }else if(l > 0){
          ans -= a[0];
        }else{
          ans -= a[n - 1];
        }
      	System.out.println(ans);
 
    }
}