import java.util.*;
 
class Main {
    public static void main(String[] args) {
      
        Scanner sc = new Scanner(System.in);
        int apple = sc.nextInt();
      	int L     = sc.nextInt();
      	int min = 1000;
      	int cnt = 0;
      
      for(int i = 1;i <= apple;i++){
      	int nam = L + i -1;
      	min = Math.min(min,Math.abs(nam));
      	cnt += nam;
      }
 	
     if(cnt<0){
		System.out.print(cnt+min);
     }else{
     	System.out.print(cnt-min);
     }

    }
} import java.util.*; util.* java class Main {
    public static void main(String[] args) {
      
        Scanner sc = new Scanner(System.in);
        int apple = sc.nextInt();
      	int L     = sc.nextInt();
      	int min = 1000;
      	int cnt = 0;
      
      for(int i = 1;i <= apple;i++){
      	int nam = L + i -1;
      	min = Math.min(min,Math.abs(nam));
      	cnt += nam;
      }
 	
     if(cnt<0){
		System.out.print(cnt+min);
     }else{
     	System.out.print(cnt-min);
     }

    }
} Main public static void main(String[] args) {
      
        Scanner sc = new Scanner(System.in);
        int apple = sc.nextInt();
      	int L     = sc.nextInt();
      	int min = 1000;
      	int cnt = 0;
      
      for(int i = 1;i <= apple;i++){
      	int nam = L + i -1;
      	min = Math.min(min,Math.abs(nam));
      	cnt += nam;
      }
 	
     if(cnt<0){
		System.out.print(cnt+min);
     }else{
     	System.out.print(cnt-min);
     }

    } main {
      
        Scanner sc = new Scanner(System.in);
        int apple = sc.nextInt();
      	int L     = sc.nextInt();
      	int min = 1000;
      	int cnt = 0;
      
      for(int i = 1;i <= apple;i++){
      	int nam = L + i -1;
      	min = Math.min(min,Math.abs(nam));
      	cnt += nam;
      }
 	
     if(cnt<0){
		System.out.print(cnt+min);
     }else{
     	System.out.print(cnt-min);
     }

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int apple = sc.nextInt(); apple sc.nextInt() sc.nextInt sc int L     = sc.nextInt(); L sc.nextInt() sc.nextInt sc int min = 1000; min 1000 int cnt = 0; cnt 0 for(int i = 1;i <= apple;i++){
      	int nam = L + i -1;
      	min = Math.min(min,Math.abs(nam));
      	cnt += nam;
      } int i = 1; int i = 1; i 1 i <= apple i apple i++ i++ i {
      	int nam = L + i -1;
      	min = Math.min(min,Math.abs(nam));
      	cnt += nam;
      } {
      	int nam = L + i -1;
      	min = Math.min(min,Math.abs(nam));
      	cnt += nam;
      } int nam = L + i -1; nam L + i -1 L + i L i 1 min = Math.min(min,Math.abs(nam)) min Math.min(min,Math.abs(nam)) Math.min Math min Math.abs(nam) Math.abs Math nam cnt += nam cnt nam if(cnt<0){
		System.out.print(cnt+min);
     }else{
     	System.out.print(cnt-min);
     } cnt<0 cnt 0 {
		System.out.print(cnt+min);
     } System.out.print(cnt+min) System.out.print System.out System System.out cnt+min cnt min {
     	System.out.print(cnt-min);
     } System.out.print(cnt-min) System.out.print System.out System System.out cnt-min cnt min String[] args args
import java.util.*;
 
class Main {
    public static void main(String[] args) {
      
        Scanner sc = new Scanner(System.in);
        int apple = sc.nextInt();
      	int L     = sc.nextInt();
      	int min = 1000;
      	int cnt = 0;
      
      for(int i = 1;i <= apple;i++){
      	int nam = L + i -1;
      	min = Math.min(min,Math.abs(nam));
      	cnt += nam;
      }
 	
     if(cnt<0){
		System.out.print(cnt+min);
     }else{
     	System.out.print(cnt-min);
     }

    }
}