import java.util.*;
import java.lang.*;

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

        int[] apple = new int[N+1];
        int A = 0;
        for(int i = 1 ; i <= N ; i++){
            apple[i] = L+i-1;
            A += apple[i];
        }
        sc.close();
        int ans = Integer.MAX_VALUE;
        int ans2 = 0;
        for(int i = 1 ; i <= N ; i++){
            int B = 0;
            for(int j = 1 ; j < i ; j++){
                B += apple[j];
            }
            for(int k = i+1 ; k <= N ; k++){
                B +=apple[k];
            }
            if(ans > Math.abs(A-B)){
                ans = Math.min(ans, Math.abs(A-B));
                ans2 = B;
            }
        }
        System.out.println(ans2);
    }

} import java.util.*; util.* java import java.lang.*; lang.* java class Main{
    
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int L = sc.nextInt();

        int[] apple = new int[N+1];
        int A = 0;
        for(int i = 1 ; i <= N ; i++){
            apple[i] = L+i-1;
            A += apple[i];
        }
        sc.close();
        int ans = Integer.MAX_VALUE;
        int ans2 = 0;
        for(int i = 1 ; i <= N ; i++){
            int B = 0;
            for(int j = 1 ; j < i ; j++){
                B += apple[j];
            }
            for(int k = i+1 ; k <= N ; k++){
                B +=apple[k];
            }
            if(ans > Math.abs(A-B)){
                ans = Math.min(ans, Math.abs(A-B));
                ans2 = B;
            }
        }
        System.out.println(ans2);
    }

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

        int[] apple = new int[N+1];
        int A = 0;
        for(int i = 1 ; i <= N ; i++){
            apple[i] = L+i-1;
            A += apple[i];
        }
        sc.close();
        int ans = Integer.MAX_VALUE;
        int ans2 = 0;
        for(int i = 1 ; i <= N ; i++){
            int B = 0;
            for(int j = 1 ; j < i ; j++){
                B += apple[j];
            }
            for(int k = i+1 ; k <= N ; k++){
                B +=apple[k];
            }
            if(ans > Math.abs(A-B)){
                ans = Math.min(ans, Math.abs(A-B));
                ans2 = B;
            }
        }
        System.out.println(ans2);
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int L = sc.nextInt();

        int[] apple = new int[N+1];
        int A = 0;
        for(int i = 1 ; i <= N ; i++){
            apple[i] = L+i-1;
            A += apple[i];
        }
        sc.close();
        int ans = Integer.MAX_VALUE;
        int ans2 = 0;
        for(int i = 1 ; i <= N ; i++){
            int B = 0;
            for(int j = 1 ; j < i ; j++){
                B += apple[j];
            }
            for(int k = i+1 ; k <= N ; k++){
                B +=apple[k];
            }
            if(ans > Math.abs(A-B)){
                ans = Math.min(ans, Math.abs(A-B));
                ans2 = B;
            }
        }
        System.out.println(ans2);
    } 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[] apple = new int[N+1]; apple new int[N+1] N+1 N 1 int A = 0; A 0 for(int i = 1 ; i <= N ; i++){
            apple[i] = L+i-1;
            A += apple[i];
        } int i = 1 ; int i = 1 ; i 1 i <= N i N i++ i++ i {
            apple[i] = L+i-1;
            A += apple[i];
        } {
            apple[i] = L+i-1;
            A += apple[i];
        } apple[i] = L+i-1 apple[i] apple i L+i-1 L+i L i 1 A += apple[i] A apple[i] apple i sc.close() sc.close sc int ans = Integer.MAX_VALUE; ans Integer.MAX_VALUE Integer Integer.MAX_VALUE int ans2 = 0; ans2 0 for(int i = 1 ; i <= N ; i++){
            int B = 0;
            for(int j = 1 ; j < i ; j++){
                B += apple[j];
            }
            for(int k = i+1 ; k <= N ; k++){
                B +=apple[k];
            }
            if(ans > Math.abs(A-B)){
                ans = Math.min(ans, Math.abs(A-B));
                ans2 = B;
            }
        } int i = 1 ; int i = 1 ; i 1 i <= N i N i++ i++ i {
            int B = 0;
            for(int j = 1 ; j < i ; j++){
                B += apple[j];
            }
            for(int k = i+1 ; k <= N ; k++){
                B +=apple[k];
            }
            if(ans > Math.abs(A-B)){
                ans = Math.min(ans, Math.abs(A-B));
                ans2 = B;
            }
        } {
            int B = 0;
            for(int j = 1 ; j < i ; j++){
                B += apple[j];
            }
            for(int k = i+1 ; k <= N ; k++){
                B +=apple[k];
            }
            if(ans > Math.abs(A-B)){
                ans = Math.min(ans, Math.abs(A-B));
                ans2 = B;
            }
        } int B = 0; B 0 for(int j = 1 ; j < i ; j++){
                B += apple[j];
            } int j = 1 ; int j = 1 ; j 1 j < i j i j++ j++ j {
                B += apple[j];
            } {
                B += apple[j];
            } B += apple[j] B apple[j] apple j for(int k = i+1 ; k <= N ; k++){
                B +=apple[k];
            } int k = i+1 ; int k = i+1 ; k i+1 i 1 k <= N k N k++ k++ k {
                B +=apple[k];
            } {
                B +=apple[k];
            } B +=apple[k] B apple[k] apple k if(ans > Math.abs(A-B)){
                ans = Math.min(ans, Math.abs(A-B));
                ans2 = B;
            } ans > Math.abs(A-B) ans Math.abs(A-B) Math.abs Math A-B A B {
                ans = Math.min(ans, Math.abs(A-B));
                ans2 = B;
            } ans = Math.min(ans, Math.abs(A-B)) ans Math.min(ans, Math.abs(A-B)) Math.min Math ans Math.abs(A-B) Math.abs Math A-B A B ans2 = B ans2 B System.out.println(ans2) System.out.println System.out System System.out ans2 String[] args args
import java.util.*;
import java.lang.*;

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

        int[] apple = new int[N+1];
        int A = 0;
        for(int i = 1 ; i <= N ; i++){
            apple[i] = L+i-1;
            A += apple[i];
        }
        sc.close();
        int ans = Integer.MAX_VALUE;
        int ans2 = 0;
        for(int i = 1 ; i <= N ; i++){
            int B = 0;
            for(int j = 1 ; j < i ; j++){
                B += apple[j];
            }
            for(int k = i+1 ; k <= N ; k++){
                B +=apple[k];
            }
            if(ans > Math.abs(A-B)){
                ans = Math.min(ans, Math.abs(A-B));
                ans2 = B;
            }
        }
        System.out.println(ans2);
    }

}