import java.util.*;
import java.lang.Object;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        int[] aji = new int[n];
        int sum = 0;
        int sabun = 99999;
        int min = 999999;
        int num = 0;

        for(int i = 0;i<n;i++){
            aji[i] = l+i;
            sum +=aji[i];
        }
        //System.out.println(sum);

        for(int i = 0;i<n;i++){
            sabun = Math.abs(sum - (sum - aji[i]));
            if(min>sabun){
                min = sabun;
                num = i;
            }
        }
        //System.out.println(min);
        System.out.println(sum-aji[num]);

    }
} import java.util.*; util.* java import java.lang.Object; Object java.lang public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        int[] aji = new int[n];
        int sum = 0;
        int sabun = 99999;
        int min = 999999;
        int num = 0;

        for(int i = 0;i<n;i++){
            aji[i] = l+i;
            sum +=aji[i];
        }
        //System.out.println(sum);

        for(int i = 0;i<n;i++){
            sabun = Math.abs(sum - (sum - aji[i]));
            if(min>sabun){
                min = sabun;
                num = i;
            }
        }
        //System.out.println(min);
        System.out.println(sum-aji[num]);

    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        int[] aji = new int[n];
        int sum = 0;
        int sabun = 99999;
        int min = 999999;
        int num = 0;

        for(int i = 0;i<n;i++){
            aji[i] = l+i;
            sum +=aji[i];
        }
        //System.out.println(sum);

        for(int i = 0;i<n;i++){
            sabun = Math.abs(sum - (sum - aji[i]));
            if(min>sabun){
                min = sabun;
                num = i;
            }
        }
        //System.out.println(min);
        System.out.println(sum-aji[num]);

    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        int[] aji = new int[n];
        int sum = 0;
        int sabun = 99999;
        int min = 999999;
        int num = 0;

        for(int i = 0;i<n;i++){
            aji[i] = l+i;
            sum +=aji[i];
        }
        //System.out.println(sum);

        for(int i = 0;i<n;i++){
            sabun = Math.abs(sum - (sum - aji[i]));
            if(min>sabun){
                min = sabun;
                num = i;
            }
        }
        //System.out.println(min);
        System.out.println(sum-aji[num]);

    } 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[] aji = new int[n]; aji new int[n] n int sum = 0; sum 0 int sabun = 99999; sabun 99999 int min = 999999; min 999999 int num = 0; num 0 for(int i = 0;i<n;i++){
            aji[i] = l+i;
            sum +=aji[i];
        } int i = 0; int i = 0; i 0 i<n i n i++ i++ i {
            aji[i] = l+i;
            sum +=aji[i];
        } {
            aji[i] = l+i;
            sum +=aji[i];
        } aji[i] = l+i aji[i] aji i l+i l i sum +=aji[i] sum aji[i] aji i for(int i = 0;i<n;i++){
            sabun = Math.abs(sum - (sum - aji[i]));
            if(min>sabun){
                min = sabun;
                num = i;
            }
        } int i = 0; int i = 0; i 0 i<n i n i++ i++ i {
            sabun = Math.abs(sum - (sum - aji[i]));
            if(min>sabun){
                min = sabun;
                num = i;
            }
        } {
            sabun = Math.abs(sum - (sum - aji[i]));
            if(min>sabun){
                min = sabun;
                num = i;
            }
        } sabun = Math.abs(sum - (sum - aji[i])) sabun Math.abs(sum - (sum - aji[i])) Math.abs Math sum - (sum - aji[i]) sum (sum - aji[i]) sum aji[i] aji i if(min>sabun){
                min = sabun;
                num = i;
            } min>sabun min sabun {
                min = sabun;
                num = i;
            } min = sabun min sabun num = i num i System.out.println(sum-aji[num]) System.out.println System.out System System.out sum-aji[num] sum aji[num] aji num 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[] aji = new int[n];
        int sum = 0;
        int sabun = 99999;
        int min = 999999;
        int num = 0;

        for(int i = 0;i<n;i++){
            aji[i] = l+i;
            sum +=aji[i];
        }
        //System.out.println(sum);

        for(int i = 0;i<n;i++){
            sabun = Math.abs(sum - (sum - aji[i]));
            if(min>sabun){
                min = sabun;
                num = i;
            }
        }
        //System.out.println(min);
        System.out.println(sum-aji[num]);

    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        int[] aji = new int[n];
        int sum = 0;
        int sabun = 99999;
        int min = 999999;
        int num = 0;

        for(int i = 0;i<n;i++){
            aji[i] = l+i;
            sum +=aji[i];
        }
        //System.out.println(sum);

        for(int i = 0;i<n;i++){
            sabun = Math.abs(sum - (sum - aji[i]));
            if(min>sabun){
                min = sabun;
                num = i;
            }
        }
        //System.out.println(min);
        System.out.println(sum-aji[num]);

    }
} Main
import java.util.*;
import java.lang.Object;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        int[] aji = new int[n];
        int sum = 0;
        int sabun = 99999;
        int min = 999999;
        int num = 0;

        for(int i = 0;i<n;i++){
            aji[i] = l+i;
            sum +=aji[i];
        }
        //System.out.println(sum);

        for(int i = 0;i<n;i++){
            sabun = Math.abs(sum - (sum - aji[i]));
            if(min>sabun){
                min = sabun;
                num = i;
            }
        }
        //System.out.println(min);
        System.out.println(sum-aji[num]);

    }
}
