import java.util.Scanner;

public class Main{
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int n=scanner.nextInt();
    int l=scanner.nextInt();
    int aji[]=new int[n];
    int num[]=new int[n];
    int max=0;
    int ans=100000;
    int a=0;

    for(int i=0;i<n;i++){
      aji[i]=l+i;
    }

    for(int i=0;i<n;i++){
      max+=aji[i];
    }

    for(int i=0;i<n;i++){
      num[i]=max-aji[i];
    }

    for(int i=0;i<n;i++){
      if(ans>Math.abs(max-num[i])){
        a=num[i];
        ans=Math.abs(max-num[i]);
      }
    }


    System.out.println(a);
  }
} import java.util.Scanner; Scanner java.util public class Main{
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int n=scanner.nextInt();
    int l=scanner.nextInt();
    int aji[]=new int[n];
    int num[]=new int[n];
    int max=0;
    int ans=100000;
    int a=0;

    for(int i=0;i<n;i++){
      aji[i]=l+i;
    }

    for(int i=0;i<n;i++){
      max+=aji[i];
    }

    for(int i=0;i<n;i++){
      num[i]=max-aji[i];
    }

    for(int i=0;i<n;i++){
      if(ans>Math.abs(max-num[i])){
        a=num[i];
        ans=Math.abs(max-num[i]);
      }
    }


    System.out.println(a);
  }
} Main public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int n=scanner.nextInt();
    int l=scanner.nextInt();
    int aji[]=new int[n];
    int num[]=new int[n];
    int max=0;
    int ans=100000;
    int a=0;

    for(int i=0;i<n;i++){
      aji[i]=l+i;
    }

    for(int i=0;i<n;i++){
      max+=aji[i];
    }

    for(int i=0;i<n;i++){
      num[i]=max-aji[i];
    }

    for(int i=0;i<n;i++){
      if(ans>Math.abs(max-num[i])){
        a=num[i];
        ans=Math.abs(max-num[i]);
      }
    }


    System.out.println(a);
  } main {
    Scanner scanner = new Scanner(System.in);
    int n=scanner.nextInt();
    int l=scanner.nextInt();
    int aji[]=new int[n];
    int num[]=new int[n];
    int max=0;
    int ans=100000;
    int a=0;

    for(int i=0;i<n;i++){
      aji[i]=l+i;
    }

    for(int i=0;i<n;i++){
      max+=aji[i];
    }

    for(int i=0;i<n;i++){
      num[i]=max-aji[i];
    }

    for(int i=0;i<n;i++){
      if(ans>Math.abs(max-num[i])){
        a=num[i];
        ans=Math.abs(max-num[i]);
      }
    }


    System.out.println(a);
  } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n=scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int l=scanner.nextInt(); l scanner.nextInt() scanner.nextInt scanner int aji[]=new int[n]; aji new int[n] n int num[]=new int[n]; num new int[n] n int max=0; max 0 int ans=100000; ans 100000 int a=0; a 0 for(int i=0;i<n;i++){
      aji[i]=l+i;
    } int i=0; int i=0; i 0 i<n i n i++ i++ i {
      aji[i]=l+i;
    } {
      aji[i]=l+i;
    } aji[i]=l+i aji[i] aji i l+i l i for(int i=0;i<n;i++){
      max+=aji[i];
    } int i=0; int i=0; i 0 i<n i n i++ i++ i {
      max+=aji[i];
    } {
      max+=aji[i];
    } max+=aji[i] max aji[i] aji i for(int i=0;i<n;i++){
      num[i]=max-aji[i];
    } int i=0; int i=0; i 0 i<n i n i++ i++ i {
      num[i]=max-aji[i];
    } {
      num[i]=max-aji[i];
    } num[i]=max-aji[i] num[i] num i max-aji[i] max aji[i] aji i for(int i=0;i<n;i++){
      if(ans>Math.abs(max-num[i])){
        a=num[i];
        ans=Math.abs(max-num[i]);
      }
    } int i=0; int i=0; i 0 i<n i n i++ i++ i {
      if(ans>Math.abs(max-num[i])){
        a=num[i];
        ans=Math.abs(max-num[i]);
      }
    } {
      if(ans>Math.abs(max-num[i])){
        a=num[i];
        ans=Math.abs(max-num[i]);
      }
    } if(ans>Math.abs(max-num[i])){
        a=num[i];
        ans=Math.abs(max-num[i]);
      } ans>Math.abs(max-num[i]) ans Math.abs(max-num[i]) Math.abs Math max-num[i] max num[i] num i {
        a=num[i];
        ans=Math.abs(max-num[i]);
      } a=num[i] a num[i] num i ans=Math.abs(max-num[i]) ans Math.abs(max-num[i]) Math.abs Math max-num[i] max num[i] num i System.out.println(a) System.out.println System.out System System.out a String[] args args public class Main{
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int n=scanner.nextInt();
    int l=scanner.nextInt();
    int aji[]=new int[n];
    int num[]=new int[n];
    int max=0;
    int ans=100000;
    int a=0;

    for(int i=0;i<n;i++){
      aji[i]=l+i;
    }

    for(int i=0;i<n;i++){
      max+=aji[i];
    }

    for(int i=0;i<n;i++){
      num[i]=max-aji[i];
    }

    for(int i=0;i<n;i++){
      if(ans>Math.abs(max-num[i])){
        a=num[i];
        ans=Math.abs(max-num[i]);
      }
    }


    System.out.println(a);
  }
} public class Main{
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int n=scanner.nextInt();
    int l=scanner.nextInt();
    int aji[]=new int[n];
    int num[]=new int[n];
    int max=0;
    int ans=100000;
    int a=0;

    for(int i=0;i<n;i++){
      aji[i]=l+i;
    }

    for(int i=0;i<n;i++){
      max+=aji[i];
    }

    for(int i=0;i<n;i++){
      num[i]=max-aji[i];
    }

    for(int i=0;i<n;i++){
      if(ans>Math.abs(max-num[i])){
        a=num[i];
        ans=Math.abs(max-num[i]);
      }
    }


    System.out.println(a);
  }
} Main
import java.util.Scanner;

public class Main{
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int n=scanner.nextInt();
    int l=scanner.nextInt();
    int aji[]=new int[n];
    int num[]=new int[n];
    int max=0;
    int ans=100000;
    int a=0;

    for(int i=0;i<n;i++){
      aji[i]=l+i;
    }

    for(int i=0;i<n;i++){
      max+=aji[i];
    }

    for(int i=0;i<n;i++){
      num[i]=max-aji[i];
    }

    for(int i=0;i<n;i++){
      if(ans>Math.abs(max-num[i])){
        a=num[i];
        ans=Math.abs(max-num[i]);
      }
    }


    System.out.println(a);
  }
}
