import java.util.Arrays;
import java.util.Scanner;
public class Main {
    public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int L = sc.nextInt();
    int[]a = new int[N];
 
    int all = 0;		
    for(int i=0; i<N; i++) {
    	a[i] = L+i;
    	all += a[i];
    a[i] = Math.abs(a[i]); 
    }
    Arrays.sort(a);

    	
    	
    if(L+N-1<0) {
    	System.out.println(all+a[0]);
    }else {
    	System.out.println(all-a[0]);
    }
}
} 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 N = sc.nextInt();
    int L = sc.nextInt();
    int[]a = new int[N];
 
    int all = 0;		
    for(int i=0; i<N; i++) {
    	a[i] = L+i;
    	all += a[i];
    a[i] = Math.abs(a[i]); 
    }
    Arrays.sort(a);

    	
    	
    if(L+N-1<0) {
    	System.out.println(all+a[0]);
    }else {
    	System.out.println(all-a[0]);
    }
}
} Main public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int L = sc.nextInt();
    int[]a = new int[N];
 
    int all = 0;		
    for(int i=0; i<N; i++) {
    	a[i] = L+i;
    	all += a[i];
    a[i] = Math.abs(a[i]); 
    }
    Arrays.sort(a);

    	
    	
    if(L+N-1<0) {
    	System.out.println(all+a[0]);
    }else {
    	System.out.println(all-a[0]);
    }
} main {
    
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int L = sc.nextInt();
    int[]a = new int[N];
 
    int all = 0;		
    for(int i=0; i<N; i++) {
    	a[i] = L+i;
    	all += a[i];
    a[i] = Math.abs(a[i]); 
    }
    Arrays.sort(a);

    	
    	
    if(L+N-1<0) {
    	System.out.println(all+a[0]);
    }else {
    	System.out.println(all-a[0]);
    }
} 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[]a = new int[N]; a new int[N] N int all = 0; all 0 for(int i=0; i<N; i++) {
    	a[i] = L+i;
    	all += a[i];
    a[i] = Math.abs(a[i]); 
    } int i=0; int i=0; i 0 i<N i N i++ i++ i {
    	a[i] = L+i;
    	all += a[i];
    a[i] = Math.abs(a[i]); 
    } {
    	a[i] = L+i;
    	all += a[i];
    a[i] = Math.abs(a[i]); 
    } a[i] = L+i a[i] a i L+i L i all += a[i] all a[i] a i a[i] = Math.abs(a[i]) a[i] a i Math.abs(a[i]) Math.abs Math a[i] a i Arrays.sort(a) Arrays.sort Arrays a if(L+N-1<0) {
    	System.out.println(all+a[0]);
    }else {
    	System.out.println(all-a[0]);
    } L+N-1<0 L+N-1 L+N L N 1 0 {
    	System.out.println(all+a[0]);
    } System.out.println(all+a[0]) System.out.println System.out System System.out all+a[0] all a[0] a 0 {
    	System.out.println(all-a[0]);
    } System.out.println(all-a[0]) System.out.println System.out System System.out all-a[0] all a[0] a 0 String[] args args public class Main {
    public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int L = sc.nextInt();
    int[]a = new int[N];
 
    int all = 0;		
    for(int i=0; i<N; i++) {
    	a[i] = L+i;
    	all += a[i];
    a[i] = Math.abs(a[i]); 
    }
    Arrays.sort(a);

    	
    	
    if(L+N-1<0) {
    	System.out.println(all+a[0]);
    }else {
    	System.out.println(all-a[0]);
    }
}
} public class Main {
    public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int L = sc.nextInt();
    int[]a = new int[N];
 
    int all = 0;		
    for(int i=0; i<N; i++) {
    	a[i] = L+i;
    	all += a[i];
    a[i] = Math.abs(a[i]); 
    }
    Arrays.sort(a);

    	
    	
    if(L+N-1<0) {
    	System.out.println(all+a[0]);
    }else {
    	System.out.println(all-a[0]);
    }
}
} 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 N = sc.nextInt();
    int L = sc.nextInt();
    int[]a = new int[N];
 
    int all = 0;		
    for(int i=0; i<N; i++) {
    	a[i] = L+i;
    	all += a[i];
    a[i] = Math.abs(a[i]); 
    }
    Arrays.sort(a);

    	
    	
    if(L+N-1<0) {
    	System.out.println(all+a[0]);
    }else {
    	System.out.println(all-a[0]);
    }
}
}