import 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 sum = 0;
        for (int i=0;i<n;i++) {
            sum += l+i;
        }
        
        int min = Integer.MAX_VALUE;
        for (int i = 0;i<n;i++) {
            min = Math.min(min, Math.abs(i+l));
        }
      	if (sum > 0) {
        	System.out.println(sum - min);
        } else {
        	System.out.println(sum + min);
        }
        
    }
} import java.util.*; util.* java public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        int sum = 0;
        for (int i=0;i<n;i++) {
            sum += l+i;
        }
        
        int min = Integer.MAX_VALUE;
        for (int i = 0;i<n;i++) {
            min = Math.min(min, Math.abs(i+l));
        }
      	if (sum > 0) {
        	System.out.println(sum - min);
        } else {
        	System.out.println(sum + min);
        }
        
    }
} Main public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        int sum = 0;
        for (int i=0;i<n;i++) {
            sum += l+i;
        }
        
        int min = Integer.MAX_VALUE;
        for (int i = 0;i<n;i++) {
            min = Math.min(min, Math.abs(i+l));
        }
      	if (sum > 0) {
        	System.out.println(sum - min);
        } else {
        	System.out.println(sum + min);
        }
        
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        int sum = 0;
        for (int i=0;i<n;i++) {
            sum += l+i;
        }
        
        int min = Integer.MAX_VALUE;
        for (int i = 0;i<n;i++) {
            min = Math.min(min, Math.abs(i+l));
        }
      	if (sum > 0) {
        	System.out.println(sum - min);
        } else {
        	System.out.println(sum + min);
        }
        
    } 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 sum = 0; sum 0 for (int i=0;i<n;i++) {
            sum += l+i;
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            sum += l+i;
        } {
            sum += l+i;
        } sum += l+i sum l+i l i int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE for (int i = 0;i<n;i++) {
            min = Math.min(min, Math.abs(i+l));
        } int i = 0; int i = 0; i 0 i<n i n i++ i++ i {
            min = Math.min(min, Math.abs(i+l));
        } {
            min = Math.min(min, Math.abs(i+l));
        } min = Math.min(min, Math.abs(i+l)) min Math.min(min, Math.abs(i+l)) Math.min Math min Math.abs(i+l) Math.abs Math i+l i l if (sum > 0) {
        	System.out.println(sum - min);
        } else {
        	System.out.println(sum + min);
        } sum > 0 sum 0 {
        	System.out.println(sum - min);
        } System.out.println(sum - min) System.out.println System.out System System.out sum - min sum min {
        	System.out.println(sum + min);
        } System.out.println(sum + min) System.out.println System.out System System.out sum + min sum min 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 sum = 0;
        for (int i=0;i<n;i++) {
            sum += l+i;
        }
        
        int min = Integer.MAX_VALUE;
        for (int i = 0;i<n;i++) {
            min = Math.min(min, Math.abs(i+l));
        }
      	if (sum > 0) {
        	System.out.println(sum - min);
        } else {
        	System.out.println(sum + min);
        }
        
    }
} public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        int sum = 0;
        for (int i=0;i<n;i++) {
            sum += l+i;
        }
        
        int min = Integer.MAX_VALUE;
        for (int i = 0;i<n;i++) {
            min = Math.min(min, Math.abs(i+l));
        }
      	if (sum > 0) {
        	System.out.println(sum - min);
        } else {
        	System.out.println(sum + min);
        }
        
    }
} Main
import 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 sum = 0;
        for (int i=0;i<n;i++) {
            sum += l+i;
        }
        
        int min = Integer.MAX_VALUE;
        for (int i = 0;i<n;i++) {
            min = Math.min(min, Math.abs(i+l));
        }
      	if (sum > 0) {
        	System.out.println(sum - min);
        } else {
        	System.out.println(sum + min);
        }
        
    }
}