
import java.util.Scanner;

 class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int  n= in.nextInt();
        int L= in .nextInt();

        if(L>=0){
            int sum=0;
            for(int i=L,j=1;j<=n;i++,j++){
                sum+=i;
            }

            sum-=L;
            System.out.println(sum);
        }
        else{
            int sum=0;
            if(Math.abs(L)>=n){
                for(int i=L,j=1;j<n;i++,j++){
                    sum+=i;
                }
                System.out.println(sum);
            }
            else {
                for(int i=L,j=1;j<=n;i++,j++){
                    sum+=i;
                }
                System.out.println(sum);
            }
        }
    }
} import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int  n= in.nextInt();
        int L= in .nextInt();

        if(L>=0){
            int sum=0;
            for(int i=L,j=1;j<=n;i++,j++){
                sum+=i;
            }

            sum-=L;
            System.out.println(sum);
        }
        else{
            int sum=0;
            if(Math.abs(L)>=n){
                for(int i=L,j=1;j<n;i++,j++){
                    sum+=i;
                }
                System.out.println(sum);
            }
            else {
                for(int i=L,j=1;j<=n;i++,j++){
                    sum+=i;
                }
                System.out.println(sum);
            }
        }
    }
} Main public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int  n= in.nextInt();
        int L= in .nextInt();

        if(L>=0){
            int sum=0;
            for(int i=L,j=1;j<=n;i++,j++){
                sum+=i;
            }

            sum-=L;
            System.out.println(sum);
        }
        else{
            int sum=0;
            if(Math.abs(L)>=n){
                for(int i=L,j=1;j<n;i++,j++){
                    sum+=i;
                }
                System.out.println(sum);
            }
            else {
                for(int i=L,j=1;j<=n;i++,j++){
                    sum+=i;
                }
                System.out.println(sum);
            }
        }
    } main {
        Scanner in = new Scanner(System.in);
        int  n= in.nextInt();
        int L= in .nextInt();

        if(L>=0){
            int sum=0;
            for(int i=L,j=1;j<=n;i++,j++){
                sum+=i;
            }

            sum-=L;
            System.out.println(sum);
        }
        else{
            int sum=0;
            if(Math.abs(L)>=n){
                for(int i=L,j=1;j<n;i++,j++){
                    sum+=i;
                }
                System.out.println(sum);
            }
            else {
                for(int i=L,j=1;j<=n;i++,j++){
                    sum+=i;
                }
                System.out.println(sum);
            }
        }
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) int  n= in.nextInt(); n in.nextInt() in.nextInt in int L= in .nextInt(); L in .nextInt() in .nextInt in if(L>=0){
            int sum=0;
            for(int i=L,j=1;j<=n;i++,j++){
                sum+=i;
            }

            sum-=L;
            System.out.println(sum);
        }
        else{
            int sum=0;
            if(Math.abs(L)>=n){
                for(int i=L,j=1;j<n;i++,j++){
                    sum+=i;
                }
                System.out.println(sum);
            }
            else {
                for(int i=L,j=1;j<=n;i++,j++){
                    sum+=i;
                }
                System.out.println(sum);
            }
        } L>=0 L 0 {
            int sum=0;
            for(int i=L,j=1;j<=n;i++,j++){
                sum+=i;
            }

            sum-=L;
            System.out.println(sum);
        } int sum=0; sum 0 for(int i=L,j=1;j<=n;i++,j++){
                sum+=i;
            } int i=L,j=1; int i=L i L j=1; j 1 j<=n j n i++,j++ i++ i j++ j {
                sum+=i;
            } {
                sum+=i;
            } sum+=i sum i sum-=L sum L System.out.println(sum) System.out.println System.out System System.out sum {
            int sum=0;
            if(Math.abs(L)>=n){
                for(int i=L,j=1;j<n;i++,j++){
                    sum+=i;
                }
                System.out.println(sum);
            }
            else {
                for(int i=L,j=1;j<=n;i++,j++){
                    sum+=i;
                }
                System.out.println(sum);
            }
        } int sum=0; sum 0 if(Math.abs(L)>=n){
                for(int i=L,j=1;j<n;i++,j++){
                    sum+=i;
                }
                System.out.println(sum);
            }
            else {
                for(int i=L,j=1;j<=n;i++,j++){
                    sum+=i;
                }
                System.out.println(sum);
            } Math.abs(L)>=n Math.abs(L) Math.abs Math L n {
                for(int i=L,j=1;j<n;i++,j++){
                    sum+=i;
                }
                System.out.println(sum);
            } for(int i=L,j=1;j<n;i++,j++){
                    sum+=i;
                } int i=L,j=1; int i=L i L j=1; j 1 j<n j n i++,j++ i++ i j++ j {
                    sum+=i;
                } {
                    sum+=i;
                } sum+=i sum i System.out.println(sum) System.out.println System.out System System.out sum {
                for(int i=L,j=1;j<=n;i++,j++){
                    sum+=i;
                }
                System.out.println(sum);
            } for(int i=L,j=1;j<=n;i++,j++){
                    sum+=i;
                } int i=L,j=1; int i=L i L j=1; j 1 j<=n j n i++,j++ i++ i j++ j {
                    sum+=i;
                } {
                    sum+=i;
                } sum+=i sum i System.out.println(sum) System.out.println System.out System System.out sum String[] args args

import java.util.Scanner;

 class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int  n= in.nextInt();
        int L= in .nextInt();

        if(L>=0){
            int sum=0;
            for(int i=L,j=1;j<=n;i++,j++){
                sum+=i;
            }

            sum-=L;
            System.out.println(sum);
        }
        else{
            int sum=0;
            if(Math.abs(L)>=n){
                for(int i=L,j=1;j<n;i++,j++){
                    sum+=i;
                }
                System.out.println(sum);
            }
            else {
                for(int i=L,j=1;j<=n;i++,j++){
                    sum+=i;
                }
                System.out.println(sum);
            }
        }
    }
}
