import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt(), L = sc.nextInt();
    int[] A = new int[N];
    A[0] = L;
    for (int i = 1; i < N; i++) A[i] = A[i - 1] + 1;
    int ans = 0, min = 10000, ans2 = 0;
    for (int i = 0; i < N; i++) {
      ans += A[i];
      if (min > Math.abs(A[i])) {
        min = Math.abs(A[i]);
        ans2 = A[i];
      }
    }
    System.out.println(ans - ans2);
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt(), L = sc.nextInt();
    int[] A = new int[N];
    A[0] = L;
    for (int i = 1; i < N; i++) A[i] = A[i - 1] + 1;
    int ans = 0, min = 10000, ans2 = 0;
    for (int i = 0; i < N; i++) {
      ans += A[i];
      if (min > Math.abs(A[i])) {
        min = Math.abs(A[i]);
        ans2 = A[i];
      }
    }
    System.out.println(ans - ans2);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt(), L = sc.nextInt();
    int[] A = new int[N];
    A[0] = L;
    for (int i = 1; i < N; i++) A[i] = A[i - 1] + 1;
    int ans = 0, min = 10000, ans2 = 0;
    for (int i = 0; i < N; i++) {
      ans += A[i];
      if (min > Math.abs(A[i])) {
        min = Math.abs(A[i]);
        ans2 = A[i];
      }
    }
    System.out.println(ans - ans2);
  } main {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt(), L = sc.nextInt();
    int[] A = new int[N];
    A[0] = L;
    for (int i = 1; i < N; i++) A[i] = A[i - 1] + 1;
    int ans = 0, min = 10000, ans2 = 0;
    for (int i = 0; i < N; i++) {
      ans += A[i];
      if (min > Math.abs(A[i])) {
        min = Math.abs(A[i]);
        ans2 = A[i];
      }
    }
    System.out.println(ans - ans2);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt() N sc.nextInt() sc.nextInt sc L = sc.nextInt(); L sc.nextInt() sc.nextInt sc int[] A = new int[N]; A new int[N] N A[0] = L A[0] A 0 L for (int i = 1; i < N; i++) A[i] = A[i - 1] + 1; int i = 1; int i = 1; i 1 i < N i N i++ i++ i A[i] = A[i - 1] + 1; A[i] = A[i - 1] + 1 A[i] A i A[i - 1] + 1 A[i - 1] A i - 1 i 1 1 int ans = 0 ans 0 min = 10000 min 10000 ans2 = 0; ans2 0 for (int i = 0; i < N; i++) {
      ans += A[i];
      if (min > Math.abs(A[i])) {
        min = Math.abs(A[i]);
        ans2 = A[i];
      }
    } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
      ans += A[i];
      if (min > Math.abs(A[i])) {
        min = Math.abs(A[i]);
        ans2 = A[i];
      }
    } {
      ans += A[i];
      if (min > Math.abs(A[i])) {
        min = Math.abs(A[i]);
        ans2 = A[i];
      }
    } ans += A[i] ans A[i] A i if (min > Math.abs(A[i])) {
        min = Math.abs(A[i]);
        ans2 = A[i];
      } min > Math.abs(A[i]) min Math.abs(A[i]) Math.abs Math A[i] A i {
        min = Math.abs(A[i]);
        ans2 = A[i];
      } min = Math.abs(A[i]) min Math.abs(A[i]) Math.abs Math A[i] A i ans2 = A[i] ans2 A[i] A i System.out.println(ans - ans2) System.out.println System.out System System.out ans - ans2 ans ans2 String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt(), L = sc.nextInt();
    int[] A = new int[N];
    A[0] = L;
    for (int i = 1; i < N; i++) A[i] = A[i - 1] + 1;
    int ans = 0, min = 10000, ans2 = 0;
    for (int i = 0; i < N; i++) {
      ans += A[i];
      if (min > Math.abs(A[i])) {
        min = Math.abs(A[i]);
        ans2 = A[i];
      }
    }
    System.out.println(ans - ans2);
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt(), L = sc.nextInt();
    int[] A = new int[N];
    A[0] = L;
    for (int i = 1; i < N; i++) A[i] = A[i - 1] + 1;
    int ans = 0, min = 10000, ans2 = 0;
    for (int i = 0; i < N; i++) {
      ans += A[i];
      if (min > Math.abs(A[i])) {
        min = Math.abs(A[i]);
        ans2 = A[i];
      }
    }
    System.out.println(ans - ans2);
  }
} Main
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt(), L = sc.nextInt();
    int[] A = new int[N];
    A[0] = L;
    for (int i = 1; i < N; i++) A[i] = A[i - 1] + 1;
    int ans = 0, min = 10000, ans2 = 0;
    for (int i = 0; i < N; i++) {
      ans += A[i];
      if (min > Math.abs(A[i])) {
        min = Math.abs(A[i]);
        ans2 = A[i];
      }
    }
    System.out.println(ans - ans2);
  }
}