import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int l = Integer.parseInt(sc.next());

    if(l<0 && n+l-1<0){
      System.out.println((2*l+n-2)*(n-1)/2);
    }else if(l>0){
      System.out.println((2*l+n)*(n-1)/2);
    }else{
      System.out.println((2*l+n-1)*n/2);
    }

  }
} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int l = Integer.parseInt(sc.next());

    if(l<0 && n+l-1<0){
      System.out.println((2*l+n-2)*(n-1)/2);
    }else if(l>0){
      System.out.println((2*l+n)*(n-1)/2);
    }else{
      System.out.println((2*l+n-1)*n/2);
    }

  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int l = Integer.parseInt(sc.next());

    if(l<0 && n+l-1<0){
      System.out.println((2*l+n-2)*(n-1)/2);
    }else if(l>0){
      System.out.println((2*l+n)*(n-1)/2);
    }else{
      System.out.println((2*l+n-1)*n/2);
    }

  } main {
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int l = Integer.parseInt(sc.next());

    if(l<0 && n+l-1<0){
      System.out.println((2*l+n-2)*(n-1)/2);
    }else if(l>0){
      System.out.println((2*l+n)*(n-1)/2);
    }else{
      System.out.println((2*l+n-1)*n/2);
    }

  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int l = Integer.parseInt(sc.next()); l Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc if(l<0 && n+l-1<0){
      System.out.println((2*l+n-2)*(n-1)/2);
    }else if(l>0){
      System.out.println((2*l+n)*(n-1)/2);
    }else{
      System.out.println((2*l+n-1)*n/2);
    } l<0 && n+l-1<0 l<0 l 0 n+l-1<0 n+l-1 n+l n l 1 0 {
      System.out.println((2*l+n-2)*(n-1)/2);
    } System.out.println((2*l+n-2)*(n-1)/2) System.out.println System.out System System.out (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 if(l>0){
      System.out.println((2*l+n)*(n-1)/2);
    }else{
      System.out.println((2*l+n-1)*n/2);
    } l>0 l 0 {
      System.out.println((2*l+n)*(n-1)/2);
    } System.out.println((2*l+n)*(n-1)/2) System.out.println System.out System System.out (2*l+n)*(n-1)/2 (2*l+n)*(n-1) (2*l+n) 2*l 2 l n (n-1) n 1 2 {
      System.out.println((2*l+n-1)*n/2);
    } System.out.println((2*l+n-1)*n/2) System.out.println System.out System System.out (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 String[] args args public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int l = Integer.parseInt(sc.next());

    if(l<0 && n+l-1<0){
      System.out.println((2*l+n-2)*(n-1)/2);
    }else if(l>0){
      System.out.println((2*l+n)*(n-1)/2);
    }else{
      System.out.println((2*l+n-1)*n/2);
    }

  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int l = Integer.parseInt(sc.next());

    if(l<0 && n+l-1<0){
      System.out.println((2*l+n-2)*(n-1)/2);
    }else if(l>0){
      System.out.println((2*l+n)*(n-1)/2);
    }else{
      System.out.println((2*l+n-1)*n/2);
    }

  }
} Main
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int l = Integer.parseInt(sc.next());

    if(l<0 && n+l-1<0){
      System.out.println((2*l+n-2)*(n-1)/2);
    }else if(l>0){
      System.out.println((2*l+n)*(n-1)/2);
    }else{
      System.out.println((2*l+n-1)*n/2);
    }

  }
}