import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();
    int all = n*(2*l+n-1)/2;
    int minn = 1<<30;
    int ans = 0;
    for(int i=1;i<=n;i++){
      if(minn>Math.abs(l+i-1)){
        minn = Math.abs(l+i-1);
        ans = all-(l+i-1);
      }
    }
    System.out.println(ans);
  }
} import java.util.*; util.* java class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();
    int all = n*(2*l+n-1)/2;
    int minn = 1<<30;
    int ans = 0;
    for(int i=1;i<=n;i++){
      if(minn>Math.abs(l+i-1)){
        minn = Math.abs(l+i-1);
        ans = all-(l+i-1);
      }
    }
    System.out.println(ans);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();
    int all = n*(2*l+n-1)/2;
    int minn = 1<<30;
    int ans = 0;
    for(int i=1;i<=n;i++){
      if(minn>Math.abs(l+i-1)){
        minn = Math.abs(l+i-1);
        ans = all-(l+i-1);
      }
    }
    System.out.println(ans);
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();
    int all = n*(2*l+n-1)/2;
    int minn = 1<<30;
    int ans = 0;
    for(int i=1;i<=n;i++){
      if(minn>Math.abs(l+i-1)){
        minn = Math.abs(l+i-1);
        ans = all-(l+i-1);
      }
    }
    System.out.println(ans);
  } 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 all = n*(2*l+n-1)/2; all n*(2*l+n-1)/2 n*(2*l+n-1) n (2*l+n-1) 2*l+n 2*l 2 l n 1 2 int minn = 1<<30; minn 1<<30 1 30 int ans = 0; ans 0 for(int i=1;i<=n;i++){
      if(minn>Math.abs(l+i-1)){
        minn = Math.abs(l+i-1);
        ans = all-(l+i-1);
      }
    } int i=1; int i=1; i 1 i<=n i n i++ i++ i {
      if(minn>Math.abs(l+i-1)){
        minn = Math.abs(l+i-1);
        ans = all-(l+i-1);
      }
    } {
      if(minn>Math.abs(l+i-1)){
        minn = Math.abs(l+i-1);
        ans = all-(l+i-1);
      }
    } if(minn>Math.abs(l+i-1)){
        minn = Math.abs(l+i-1);
        ans = all-(l+i-1);
      } minn>Math.abs(l+i-1) minn Math.abs(l+i-1) Math.abs Math l+i-1 l+i l i 1 {
        minn = Math.abs(l+i-1);
        ans = all-(l+i-1);
      } minn = Math.abs(l+i-1) minn Math.abs(l+i-1) Math.abs Math l+i-1 l+i l i 1 ans = all-(l+i-1) ans all-(l+i-1) all (l+i-1) l+i l i 1 System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();
    int all = n*(2*l+n-1)/2;
    int minn = 1<<30;
    int ans = 0;
    for(int i=1;i<=n;i++){
      if(minn>Math.abs(l+i-1)){
        minn = Math.abs(l+i-1);
        ans = all-(l+i-1);
      }
    }
    System.out.println(ans);
  }
}
