import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        String[] line1 = line.split(" ");
        int n = Integer.parseInt(line1[0]);
        int l = Integer.parseInt(line1[1]);
        int[] ary = new int[n];
        int a = 0;
        for(int i = 0; i < n; i++){
            ary[i] = l + i;
            //System.out.println(ary[i]);
            if(ary[i] == 0)
            a = 1;
        }
        if(ary[0] < 0 && a == 0)
        a = 2;
        int sum = 0;
        switch(a){
            case 0:
                //System.out.println("case0");
                for(int i = 1; i < n; i++)
                sum += ary[i];
                break;
            case 1:
                //System.out.println("case1");
                for(int i = 0; i < n; i++)
                sum += ary[i];
                break;
            case 2:
                //System.out.println("case2");
                for(int i = 0; i < n - 1; i++)
                sum += ary[i];
                break;
        }
        System.out.println(sum);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        String[] line1 = line.split(" ");
        int n = Integer.parseInt(line1[0]);
        int l = Integer.parseInt(line1[1]);
        int[] ary = new int[n];
        int a = 0;
        for(int i = 0; i < n; i++){
            ary[i] = l + i;
            //System.out.println(ary[i]);
            if(ary[i] == 0)
            a = 1;
        }
        if(ary[0] < 0 && a == 0)
        a = 2;
        int sum = 0;
        switch(a){
            case 0:
                //System.out.println("case0");
                for(int i = 1; i < n; i++)
                sum += ary[i];
                break;
            case 1:
                //System.out.println("case1");
                for(int i = 0; i < n; i++)
                sum += ary[i];
                break;
            case 2:
                //System.out.println("case2");
                for(int i = 0; i < n - 1; i++)
                sum += ary[i];
                break;
        }
        System.out.println(sum);
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        String[] line1 = line.split(" ");
        int n = Integer.parseInt(line1[0]);
        int l = Integer.parseInt(line1[1]);
        int[] ary = new int[n];
        int a = 0;
        for(int i = 0; i < n; i++){
            ary[i] = l + i;
            //System.out.println(ary[i]);
            if(ary[i] == 0)
            a = 1;
        }
        if(ary[0] < 0 && a == 0)
        a = 2;
        int sum = 0;
        switch(a){
            case 0:
                //System.out.println("case0");
                for(int i = 1; i < n; i++)
                sum += ary[i];
                break;
            case 1:
                //System.out.println("case1");
                for(int i = 0; i < n; i++)
                sum += ary[i];
                break;
            case 2:
                //System.out.println("case2");
                for(int i = 0; i < n - 1; i++)
                sum += ary[i];
                break;
        }
        System.out.println(sum);
    } main {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        String[] line1 = line.split(" ");
        int n = Integer.parseInt(line1[0]);
        int l = Integer.parseInt(line1[1]);
        int[] ary = new int[n];
        int a = 0;
        for(int i = 0; i < n; i++){
            ary[i] = l + i;
            //System.out.println(ary[i]);
            if(ary[i] == 0)
            a = 1;
        }
        if(ary[0] < 0 && a == 0)
        a = 2;
        int sum = 0;
        switch(a){
            case 0:
                //System.out.println("case0");
                for(int i = 1; i < n; i++)
                sum += ary[i];
                break;
            case 1:
                //System.out.println("case1");
                for(int i = 0; i < n; i++)
                sum += ary[i];
                break;
            case 2:
                //System.out.println("case2");
                for(int i = 0; i < n - 1; i++)
                sum += ary[i];
                break;
        }
        System.out.println(sum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String line = sc.nextLine(); line sc.nextLine() sc.nextLine sc String[] line1 = line.split(" "); line1 line.split(" ") line.split line " " int n = Integer.parseInt(line1[0]); n Integer.parseInt(line1[0]) Integer.parseInt Integer line1[0] line1 0 int l = Integer.parseInt(line1[1]); l Integer.parseInt(line1[1]) Integer.parseInt Integer line1[1] line1 1 int[] ary = new int[n]; ary new int[n] n int a = 0; a 0 for(int i = 0; i < n; i++){
            ary[i] = l + i;
            //System.out.println(ary[i]);
            if(ary[i] == 0)
            a = 1;
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            ary[i] = l + i;
            //System.out.println(ary[i]);
            if(ary[i] == 0)
            a = 1;
        } {
            ary[i] = l + i;
            //System.out.println(ary[i]);
            if(ary[i] == 0)
            a = 1;
        } ary[i] = l + i ary[i] ary i l + i l i if(ary[i] == 0)
            a = 1; ary[i] == 0 ary[i] ary i 0 a = 1 a 1 if(ary[0] < 0 && a == 0)
        a = 2; ary[0] < 0 && a == 0 ary[0] < 0 ary[0] ary 0 0 a == 0 a 0 a = 2 a 2 int sum = 0; sum 0 switch(a){
            case 0:
                //System.out.println("case0");
                for(int i = 1; i < n; i++)
                sum += ary[i];
                break;
            case 1:
                //System.out.println("case1");
                for(int i = 0; i < n; i++)
                sum += ary[i];
                break;
            case 2:
                //System.out.println("case2");
                for(int i = 0; i < n - 1; i++)
                sum += ary[i];
                break;
        } a case 0: 0 case 0: for(int i = 1; i < n; i++)
                sum += ary[i]; int i = 1; int i = 1; i 1 i < n i n i++ i++ i sum += ary[i]; sum += ary[i] sum ary[i] ary i break; case 1: 1 case 1: for(int i = 0; i < n; i++)
                sum += ary[i]; int i = 0; int i = 0; i 0 i < n i n i++ i++ i sum += ary[i]; sum += ary[i] sum ary[i] ary i break; case 2: 2 case 2: for(int i = 0; i < n - 1; i++)
                sum += ary[i]; int i = 0; int i = 0; i 0 i < n - 1 i n - 1 n 1 i++ i++ i sum += ary[i]; sum += ary[i] sum ary[i] ary i break; System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        String[] line1 = line.split(" ");
        int n = Integer.parseInt(line1[0]);
        int l = Integer.parseInt(line1[1]);
        int[] ary = new int[n];
        int a = 0;
        for(int i = 0; i < n; i++){
            ary[i] = l + i;
            //System.out.println(ary[i]);
            if(ary[i] == 0)
            a = 1;
        }
        if(ary[0] < 0 && a == 0)
        a = 2;
        int sum = 0;
        switch(a){
            case 0:
                //System.out.println("case0");
                for(int i = 1; i < n; i++)
                sum += ary[i];
                break;
            case 1:
                //System.out.println("case1");
                for(int i = 0; i < n; i++)
                sum += ary[i];
                break;
            case 2:
                //System.out.println("case2");
                for(int i = 0; i < n - 1; i++)
                sum += ary[i];
                break;
        }
        System.out.println(sum);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        String[] line1 = line.split(" ");
        int n = Integer.parseInt(line1[0]);
        int l = Integer.parseInt(line1[1]);
        int[] ary = new int[n];
        int a = 0;
        for(int i = 0; i < n; i++){
            ary[i] = l + i;
            //System.out.println(ary[i]);
            if(ary[i] == 0)
            a = 1;
        }
        if(ary[0] < 0 && a == 0)
        a = 2;
        int sum = 0;
        switch(a){
            case 0:
                //System.out.println("case0");
                for(int i = 1; i < n; i++)
                sum += ary[i];
                break;
            case 1:
                //System.out.println("case1");
                for(int i = 0; i < n; i++)
                sum += ary[i];
                break;
            case 2:
                //System.out.println("case2");
                for(int i = 0; i < n - 1; i++)
                sum += ary[i];
                break;
        }
        System.out.println(sum);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        String[] line1 = line.split(" ");
        int n = Integer.parseInt(line1[0]);
        int l = Integer.parseInt(line1[1]);
        int[] ary = new int[n];
        int a = 0;
        for(int i = 0; i < n; i++){
            ary[i] = l + i;
            //System.out.println(ary[i]);
            if(ary[i] == 0)
            a = 1;
        }
        if(ary[0] < 0 && a == 0)
        a = 2;
        int sum = 0;
        switch(a){
            case 0:
                //System.out.println("case0");
                for(int i = 1; i < n; i++)
                sum += ary[i];
                break;
            case 1:
                //System.out.println("case1");
                for(int i = 0; i < n; i++)
                sum += ary[i];
                break;
            case 2:
                //System.out.println("case2");
                for(int i = 0; i < n - 1; i++)
                sum += ary[i];
                break;
        }
        System.out.println(sum);
    }
}