import java.util.Arrays;
import java.util.Scanner;
public class Main {
    
    
    
     public static void main(String[] args) {
        
         Scanner sc = new Scanner(System.in);
         int A = sc.nextInt();
         int L = sc.nextInt();
          int b[ ] = new int[A];
         int a[ ] = new int[A];
         for(int i = 0 ; i<A ; i++){
                   a[i]  =  i+1;
             
         }
         
       for(int i = 0 ; i<A ; i++){
               b[i]=  L+a[i]-1;
           
       }  
         Arrays.sort(b);
         int sum = 0 ;
         for(int i=0; i<b.length ; i++){
             sum+=b[i];
             
         }
         int bestsofar=Integer.MAX_VALUE;
         int ans=0;
         for(int i=0;i<A;i++)
         {
         int cur=sum-b[i];
         int diff=Math.abs(b[i]);
         if(diff<bestsofar)
         {
             ans=cur;
             bestsofar=diff;
         }
         }
      //   System.out.println(b[1]+b[2]+b[3]+b[4]+b[5]);
         System.out.println(ans);
         
    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
    
    
    
     public static void main(String[] args) {
        
         Scanner sc = new Scanner(System.in);
         int A = sc.nextInt();
         int L = sc.nextInt();
          int b[ ] = new int[A];
         int a[ ] = new int[A];
         for(int i = 0 ; i<A ; i++){
                   a[i]  =  i+1;
             
         }
         
       for(int i = 0 ; i<A ; i++){
               b[i]=  L+a[i]-1;
           
       }  
         Arrays.sort(b);
         int sum = 0 ;
         for(int i=0; i<b.length ; i++){
             sum+=b[i];
             
         }
         int bestsofar=Integer.MAX_VALUE;
         int ans=0;
         for(int i=0;i<A;i++)
         {
         int cur=sum-b[i];
         int diff=Math.abs(b[i]);
         if(diff<bestsofar)
         {
             ans=cur;
             bestsofar=diff;
         }
         }
      //   System.out.println(b[1]+b[2]+b[3]+b[4]+b[5]);
         System.out.println(ans);
         
    }
} Main public static void main(String[] args) {
        
         Scanner sc = new Scanner(System.in);
         int A = sc.nextInt();
         int L = sc.nextInt();
          int b[ ] = new int[A];
         int a[ ] = new int[A];
         for(int i = 0 ; i<A ; i++){
                   a[i]  =  i+1;
             
         }
         
       for(int i = 0 ; i<A ; i++){
               b[i]=  L+a[i]-1;
           
       }  
         Arrays.sort(b);
         int sum = 0 ;
         for(int i=0; i<b.length ; i++){
             sum+=b[i];
             
         }
         int bestsofar=Integer.MAX_VALUE;
         int ans=0;
         for(int i=0;i<A;i++)
         {
         int cur=sum-b[i];
         int diff=Math.abs(b[i]);
         if(diff<bestsofar)
         {
             ans=cur;
             bestsofar=diff;
         }
         }
      //   System.out.println(b[1]+b[2]+b[3]+b[4]+b[5]);
         System.out.println(ans);
         
    } main {
        
         Scanner sc = new Scanner(System.in);
         int A = sc.nextInt();
         int L = sc.nextInt();
          int b[ ] = new int[A];
         int a[ ] = new int[A];
         for(int i = 0 ; i<A ; i++){
                   a[i]  =  i+1;
             
         }
         
       for(int i = 0 ; i<A ; i++){
               b[i]=  L+a[i]-1;
           
       }  
         Arrays.sort(b);
         int sum = 0 ;
         for(int i=0; i<b.length ; i++){
             sum+=b[i];
             
         }
         int bestsofar=Integer.MAX_VALUE;
         int ans=0;
         for(int i=0;i<A;i++)
         {
         int cur=sum-b[i];
         int diff=Math.abs(b[i]);
         if(diff<bestsofar)
         {
             ans=cur;
             bestsofar=diff;
         }
         }
      //   System.out.println(b[1]+b[2]+b[3]+b[4]+b[5]);
         System.out.println(ans);
         
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A = sc.nextInt(); A sc.nextInt() sc.nextInt sc int L = sc.nextInt(); L sc.nextInt() sc.nextInt sc int b[ ] = new int[A]; b new int[A] A int a[ ] = new int[A]; a new int[A] A for(int i = 0 ; i<A ; i++){
                   a[i]  =  i+1;
             
         } int i = 0 ; int i = 0 ; i 0 i<A i A i++ i++ i {
                   a[i]  =  i+1;
             
         } {
                   a[i]  =  i+1;
             
         } a[i]  =  i+1 a[i] a i i+1 i 1 for(int i = 0 ; i<A ; i++){
               b[i]=  L+a[i]-1;
           
       } int i = 0 ; int i = 0 ; i 0 i<A i A i++ i++ i {
               b[i]=  L+a[i]-1;
           
       } {
               b[i]=  L+a[i]-1;
           
       } b[i]=  L+a[i]-1 b[i] b i L+a[i]-1 L+a[i] L a[i] a i 1 Arrays.sort(b) Arrays.sort Arrays b int sum = 0 ; sum 0 for(int i=0; i<b.length ; i++){
             sum+=b[i];
             
         } int i=0; int i=0; i 0 i<b.length i b.length b b.length i++ i++ i {
             sum+=b[i];
             
         } {
             sum+=b[i];
             
         } sum+=b[i] sum b[i] b i int bestsofar=Integer.MAX_VALUE; bestsofar Integer.MAX_VALUE Integer Integer.MAX_VALUE int ans=0; ans 0 for(int i=0;i<A;i++)
         {
         int cur=sum-b[i];
         int diff=Math.abs(b[i]);
         if(diff<bestsofar)
         {
             ans=cur;
             bestsofar=diff;
         }
         } int i=0; int i=0; i 0 i<A i A i++ i++ i {
         int cur=sum-b[i];
         int diff=Math.abs(b[i]);
         if(diff<bestsofar)
         {
             ans=cur;
             bestsofar=diff;
         }
         } {
         int cur=sum-b[i];
         int diff=Math.abs(b[i]);
         if(diff<bestsofar)
         {
             ans=cur;
             bestsofar=diff;
         }
         } int cur=sum-b[i]; cur sum-b[i] sum b[i] b i int diff=Math.abs(b[i]); diff Math.abs(b[i]) Math.abs Math b[i] b i if(diff<bestsofar)
         {
             ans=cur;
             bestsofar=diff;
         } diff<bestsofar diff bestsofar {
             ans=cur;
             bestsofar=diff;
         } ans=cur ans cur bestsofar=diff bestsofar diff System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
    
    
    
     public static void main(String[] args) {
        
         Scanner sc = new Scanner(System.in);
         int A = sc.nextInt();
         int L = sc.nextInt();
          int b[ ] = new int[A];
         int a[ ] = new int[A];
         for(int i = 0 ; i<A ; i++){
                   a[i]  =  i+1;
             
         }
         
       for(int i = 0 ; i<A ; i++){
               b[i]=  L+a[i]-1;
           
       }  
         Arrays.sort(b);
         int sum = 0 ;
         for(int i=0; i<b.length ; i++){
             sum+=b[i];
             
         }
         int bestsofar=Integer.MAX_VALUE;
         int ans=0;
         for(int i=0;i<A;i++)
         {
         int cur=sum-b[i];
         int diff=Math.abs(b[i]);
         if(diff<bestsofar)
         {
             ans=cur;
             bestsofar=diff;
         }
         }
      //   System.out.println(b[1]+b[2]+b[3]+b[4]+b[5]);
         System.out.println(ans);
         
    }
} public class Main {
    
    
    
     public static void main(String[] args) {
        
         Scanner sc = new Scanner(System.in);
         int A = sc.nextInt();
         int L = sc.nextInt();
          int b[ ] = new int[A];
         int a[ ] = new int[A];
         for(int i = 0 ; i<A ; i++){
                   a[i]  =  i+1;
             
         }
         
       for(int i = 0 ; i<A ; i++){
               b[i]=  L+a[i]-1;
           
       }  
         Arrays.sort(b);
         int sum = 0 ;
         for(int i=0; i<b.length ; i++){
             sum+=b[i];
             
         }
         int bestsofar=Integer.MAX_VALUE;
         int ans=0;
         for(int i=0;i<A;i++)
         {
         int cur=sum-b[i];
         int diff=Math.abs(b[i]);
         if(diff<bestsofar)
         {
             ans=cur;
             bestsofar=diff;
         }
         }
      //   System.out.println(b[1]+b[2]+b[3]+b[4]+b[5]);
         System.out.println(ans);
         
    }
} Main
import java.util.Arrays;
import java.util.Scanner;
public class Main {
    
    
    
     public static void main(String[] args) {
        
         Scanner sc = new Scanner(System.in);
         int A = sc.nextInt();
         int L = sc.nextInt();
          int b[ ] = new int[A];
         int a[ ] = new int[A];
         for(int i = 0 ; i<A ; i++){
                   a[i]  =  i+1;
             
         }
         
       for(int i = 0 ; i<A ; i++){
               b[i]=  L+a[i]-1;
           
       }  
         Arrays.sort(b);
         int sum = 0 ;
         for(int i=0; i<b.length ; i++){
             sum+=b[i];
             
         }
         int bestsofar=Integer.MAX_VALUE;
         int ans=0;
         for(int i=0;i<A;i++)
         {
         int cur=sum-b[i];
         int diff=Math.abs(b[i]);
         if(diff<bestsofar)
         {
             ans=cur;
             bestsofar=diff;
         }
         }
      //   System.out.println(b[1]+b[2]+b[3]+b[4]+b[5]);
         System.out.println(ans);
         
    }
}
