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

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