import java.util.*;

 
class Main {
 
    private static Scanner sc = new Scanner(System.in);
 
    public static void main(String[] args) {
        String s = sc.next();
        String s1 = sc.next();

        int n = Integer.parseInt(s);
        int l = Integer.parseInt(s1);
        //char[] code = s.toCharArray();
        int ans =0;
        //System.out.println((s + s).contains(s2) ? "Yes" : "No");
        int[] apple = new int[n+1];
        int sum = 0;
        int min = 100000;
        int min2 = 100000;
        for(int i = 1; i < n+1; i++){
            apple[i]= l+i-1;
            sum += apple[i];
            //System.out.print(apple[i]+ " ");

            if(Math.abs(apple[i])<min){
                min2 = apple[i];            
                min = Math.min(Math.abs(apple[i]),min);
            }
        }
        //System.out.println(min2);
        ans = sum - min2;




        System.out.println(ans);

    }
} import java.util.*; util.* java class Main {
 
    private static Scanner sc = new Scanner(System.in);
 
    public static void main(String[] args) {
        String s = sc.next();
        String s1 = sc.next();

        int n = Integer.parseInt(s);
        int l = Integer.parseInt(s1);
        //char[] code = s.toCharArray();
        int ans =0;
        //System.out.println((s + s).contains(s2) ? "Yes" : "No");
        int[] apple = new int[n+1];
        int sum = 0;
        int min = 100000;
        int min2 = 100000;
        for(int i = 1; i < n+1; i++){
            apple[i]= l+i-1;
            sum += apple[i];
            //System.out.print(apple[i]+ " ");

            if(Math.abs(apple[i])<min){
                min2 = apple[i];            
                min = Math.min(Math.abs(apple[i]),min);
            }
        }
        //System.out.println(min2);
        ans = sum - min2;




        System.out.println(ans);

    }
} Main private static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
        String s = sc.next();
        String s1 = sc.next();

        int n = Integer.parseInt(s);
        int l = Integer.parseInt(s1);
        //char[] code = s.toCharArray();
        int ans =0;
        //System.out.println((s + s).contains(s2) ? "Yes" : "No");
        int[] apple = new int[n+1];
        int sum = 0;
        int min = 100000;
        int min2 = 100000;
        for(int i = 1; i < n+1; i++){
            apple[i]= l+i-1;
            sum += apple[i];
            //System.out.print(apple[i]+ " ");

            if(Math.abs(apple[i])<min){
                min2 = apple[i];            
                min = Math.min(Math.abs(apple[i]),min);
            }
        }
        //System.out.println(min2);
        ans = sum - min2;




        System.out.println(ans);

    } main {
        String s = sc.next();
        String s1 = sc.next();

        int n = Integer.parseInt(s);
        int l = Integer.parseInt(s1);
        //char[] code = s.toCharArray();
        int ans =0;
        //System.out.println((s + s).contains(s2) ? "Yes" : "No");
        int[] apple = new int[n+1];
        int sum = 0;
        int min = 100000;
        int min2 = 100000;
        for(int i = 1; i < n+1; i++){
            apple[i]= l+i-1;
            sum += apple[i];
            //System.out.print(apple[i]+ " ");

            if(Math.abs(apple[i])<min){
                min2 = apple[i];            
                min = Math.min(Math.abs(apple[i]),min);
            }
        }
        //System.out.println(min2);
        ans = sum - min2;




        System.out.println(ans);

    } String s = sc.next(); s sc.next() sc.next sc String s1 = sc.next(); s1 sc.next() sc.next sc int n = Integer.parseInt(s); n Integer.parseInt(s) Integer.parseInt Integer s int l = Integer.parseInt(s1); l Integer.parseInt(s1) Integer.parseInt Integer s1 int ans =0; ans 0 int[] apple = new int[n+1]; apple new int[n+1] n+1 n 1 int sum = 0; sum 0 int min = 100000; min 100000 int min2 = 100000; min2 100000 for(int i = 1; i < n+1; i++){
            apple[i]= l+i-1;
            sum += apple[i];
            //System.out.print(apple[i]+ " ");

            if(Math.abs(apple[i])<min){
                min2 = apple[i];            
                min = Math.min(Math.abs(apple[i]),min);
            }
        } int i = 1; int i = 1; i 1 i < n+1 i n+1 n 1 i++ i++ i {
            apple[i]= l+i-1;
            sum += apple[i];
            //System.out.print(apple[i]+ " ");

            if(Math.abs(apple[i])<min){
                min2 = apple[i];            
                min = Math.min(Math.abs(apple[i]),min);
            }
        } {
            apple[i]= l+i-1;
            sum += apple[i];
            //System.out.print(apple[i]+ " ");

            if(Math.abs(apple[i])<min){
                min2 = apple[i];            
                min = Math.min(Math.abs(apple[i]),min);
            }
        } apple[i]= l+i-1 apple[i] apple i l+i-1 l+i l i 1 sum += apple[i] sum apple[i] apple i if(Math.abs(apple[i])<min){
                min2 = apple[i];            
                min = Math.min(Math.abs(apple[i]),min);
            } Math.abs(apple[i])<min Math.abs(apple[i]) Math.abs Math apple[i] apple i min {
                min2 = apple[i];            
                min = Math.min(Math.abs(apple[i]),min);
            } min2 = apple[i] min2 apple[i] apple i min = Math.min(Math.abs(apple[i]),min) min Math.min(Math.abs(apple[i]),min) Math.min Math Math.abs(apple[i]) Math.abs Math apple[i] apple i min ans = sum - min2 ans sum - min2 sum min2 System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.*;

 
class Main {
 
    private static Scanner sc = new Scanner(System.in);
 
    public static void main(String[] args) {
        String s = sc.next();
        String s1 = sc.next();

        int n = Integer.parseInt(s);
        int l = Integer.parseInt(s1);
        //char[] code = s.toCharArray();
        int ans =0;
        //System.out.println((s + s).contains(s2) ? "Yes" : "No");
        int[] apple = new int[n+1];
        int sum = 0;
        int min = 100000;
        int min2 = 100000;
        for(int i = 1; i < n+1; i++){
            apple[i]= l+i-1;
            sum += apple[i];
            //System.out.print(apple[i]+ " ");

            if(Math.abs(apple[i])<min){
                min2 = apple[i];            
                min = Math.min(Math.abs(apple[i]),min);
            }
        }
        //System.out.println(min2);
        ans = sum - min2;




        System.out.println(ans);

    }
}