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 res=0;
      if(l>0){
        res=(2*l+n)*(n-1)/2;
      }else if(l+n-1<0){
        res=(2*l+n-2)*(n-1)/2;
      }else{
        res=(2*l+n-1)*n/2;
      }
        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 res=0;
      if(l>0){
        res=(2*l+n)*(n-1)/2;
      }else if(l+n-1<0){
        res=(2*l+n-2)*(n-1)/2;
      }else{
        res=(2*l+n-1)*n/2;
      }
        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 res=0;
      if(l>0){
        res=(2*l+n)*(n-1)/2;
      }else if(l+n-1<0){
        res=(2*l+n-2)*(n-1)/2;
      }else{
        res=(2*l+n-1)*n/2;
      }
        System.out.println(res);
    } main {
        Scanner sc = new Scanner(System.in);
        // 整数の入力
        int n = sc.nextInt();
      int l = sc.nextInt();
      int res=0;
      if(l>0){
        res=(2*l+n)*(n-1)/2;
      }else if(l+n-1<0){
        res=(2*l+n-2)*(n-1)/2;
      }else{
        res=(2*l+n-1)*n/2;
      }
        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 res=0; res 0 if(l>0){
        res=(2*l+n)*(n-1)/2;
      }else if(l+n-1<0){
        res=(2*l+n-2)*(n-1)/2;
      }else{
        res=(2*l+n-1)*n/2;
      } l>0 l 0 {
        res=(2*l+n)*(n-1)/2;
      } res=(2*l+n)*(n-1)/2 res (2*l+n)*(n-1)/2 (2*l+n)*(n-1) (2*l+n) 2*l 2 l n (n-1) n 1 2 if(l+n-1<0){
        res=(2*l+n-2)*(n-1)/2;
      }else{
        res=(2*l+n-1)*n/2;
      } l+n-1<0 l+n-1 l+n l n 1 0 {
        res=(2*l+n-2)*(n-1)/2;
      } res=(2*l+n-2)*(n-1)/2 res (2*l+n-2)*(n-1)/2 (2*l+n-2)*(n-1) (2*l+n-2) 2*l+n 2*l 2 l n 2 (n-1) n 1 2 {
        res=(2*l+n-1)*n/2;
      } res=(2*l+n-1)*n/2 res (2*l+n-1)*n/2 (2*l+n-1)*n (2*l+n-1) 2*l+n 2*l 2 l n 1 n 2 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 res=0;
      if(l>0){
        res=(2*l+n)*(n-1)/2;
      }else if(l+n-1<0){
        res=(2*l+n-2)*(n-1)/2;
      }else{
        res=(2*l+n-1)*n/2;
      }
        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 res=0;
      if(l>0){
        res=(2*l+n)*(n-1)/2;
      }else if(l+n-1<0){
        res=(2*l+n-2)*(n-1)/2;
      }else{
        res=(2*l+n-1)*n/2;
      }
        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 res=0;
      if(l>0){
        res=(2*l+n)*(n-1)/2;
      }else if(l+n-1<0){
        res=(2*l+n-2)*(n-1)/2;
      }else{
        res=(2*l+n-1)*n/2;
      }
        System.out.println(res);
    }

}
