import java.util.*;
class Main{
  public static void main(String[] args){
    Scanner scan=new Scanner(System.in);
    int N=scan.nextInt();
    int L=scan.nextInt();
    int[] apple=new int[N];
    int correct=0;
    for(int i=0;i<N;i++){
      apple[i]=L+i;
      correct+=apple[i];
    }
    int[] taste=new int[N];
    int min=0;
    int ans=0;
    int tmp=0;
    int tmp_correct=0;
    int tmp_taste=0;
    boolean flag=true;
    for(int i=0;i<N;i++){
      for(int j=0;j<N;j++){
        if(i==j){
          continue;
        }
        taste[i]+=apple[j];
      }
      tmp_correct=correct;
      tmp_taste=taste[i];
      if(correct<0){
        tmp_correct=-tmp_correct;
      }
      if(tmp_taste<0){
        tmp_taste=-tmp_taste;
      }
      tmp=tmp_correct-tmp_taste;
      if(tmp<0)tmp=-tmp;
      if(flag){
        min=tmp;
        ans=taste[i];
        flag=false;
      }
      if(min>tmp){
        min=tmp;
        ans=taste[i];
      }
      // System.out.println("correct:"+correct);
      // System.out.println("taste["+i+"]"+taste[i]);
      // System.out.println("eat"+tmp);
    }
    System.out.println(ans);
  }
} import java.util.*; util.* java class Main{
  public static void main(String[] args){
    Scanner scan=new Scanner(System.in);
    int N=scan.nextInt();
    int L=scan.nextInt();
    int[] apple=new int[N];
    int correct=0;
    for(int i=0;i<N;i++){
      apple[i]=L+i;
      correct+=apple[i];
    }
    int[] taste=new int[N];
    int min=0;
    int ans=0;
    int tmp=0;
    int tmp_correct=0;
    int tmp_taste=0;
    boolean flag=true;
    for(int i=0;i<N;i++){
      for(int j=0;j<N;j++){
        if(i==j){
          continue;
        }
        taste[i]+=apple[j];
      }
      tmp_correct=correct;
      tmp_taste=taste[i];
      if(correct<0){
        tmp_correct=-tmp_correct;
      }
      if(tmp_taste<0){
        tmp_taste=-tmp_taste;
      }
      tmp=tmp_correct-tmp_taste;
      if(tmp<0)tmp=-tmp;
      if(flag){
        min=tmp;
        ans=taste[i];
        flag=false;
      }
      if(min>tmp){
        min=tmp;
        ans=taste[i];
      }
      // System.out.println("correct:"+correct);
      // System.out.println("taste["+i+"]"+taste[i]);
      // System.out.println("eat"+tmp);
    }
    System.out.println(ans);
  }
} Main public static void main(String[] args){
    Scanner scan=new Scanner(System.in);
    int N=scan.nextInt();
    int L=scan.nextInt();
    int[] apple=new int[N];
    int correct=0;
    for(int i=0;i<N;i++){
      apple[i]=L+i;
      correct+=apple[i];
    }
    int[] taste=new int[N];
    int min=0;
    int ans=0;
    int tmp=0;
    int tmp_correct=0;
    int tmp_taste=0;
    boolean flag=true;
    for(int i=0;i<N;i++){
      for(int j=0;j<N;j++){
        if(i==j){
          continue;
        }
        taste[i]+=apple[j];
      }
      tmp_correct=correct;
      tmp_taste=taste[i];
      if(correct<0){
        tmp_correct=-tmp_correct;
      }
      if(tmp_taste<0){
        tmp_taste=-tmp_taste;
      }
      tmp=tmp_correct-tmp_taste;
      if(tmp<0)tmp=-tmp;
      if(flag){
        min=tmp;
        ans=taste[i];
        flag=false;
      }
      if(min>tmp){
        min=tmp;
        ans=taste[i];
      }
      // System.out.println("correct:"+correct);
      // System.out.println("taste["+i+"]"+taste[i]);
      // System.out.println("eat"+tmp);
    }
    System.out.println(ans);
  } main {
    Scanner scan=new Scanner(System.in);
    int N=scan.nextInt();
    int L=scan.nextInt();
    int[] apple=new int[N];
    int correct=0;
    for(int i=0;i<N;i++){
      apple[i]=L+i;
      correct+=apple[i];
    }
    int[] taste=new int[N];
    int min=0;
    int ans=0;
    int tmp=0;
    int tmp_correct=0;
    int tmp_taste=0;
    boolean flag=true;
    for(int i=0;i<N;i++){
      for(int j=0;j<N;j++){
        if(i==j){
          continue;
        }
        taste[i]+=apple[j];
      }
      tmp_correct=correct;
      tmp_taste=taste[i];
      if(correct<0){
        tmp_correct=-tmp_correct;
      }
      if(tmp_taste<0){
        tmp_taste=-tmp_taste;
      }
      tmp=tmp_correct-tmp_taste;
      if(tmp<0)tmp=-tmp;
      if(flag){
        min=tmp;
        ans=taste[i];
        flag=false;
      }
      if(min>tmp){
        min=tmp;
        ans=taste[i];
      }
      // System.out.println("correct:"+correct);
      // System.out.println("taste["+i+"]"+taste[i]);
      // System.out.println("eat"+tmp);
    }
    System.out.println(ans);
  } Scanner scan=new Scanner(System.in); scan new Scanner(System.in) int N=scan.nextInt(); N scan.nextInt() scan.nextInt scan int L=scan.nextInt(); L scan.nextInt() scan.nextInt scan int[] apple=new int[N]; apple new int[N] N int correct=0; correct 0 for(int i=0;i<N;i++){
      apple[i]=L+i;
      correct+=apple[i];
    } int i=0; int i=0; i 0 i<N i N i++ i++ i {
      apple[i]=L+i;
      correct+=apple[i];
    } {
      apple[i]=L+i;
      correct+=apple[i];
    } apple[i]=L+i apple[i] apple i L+i L i correct+=apple[i] correct apple[i] apple i int[] taste=new int[N]; taste new int[N] N int min=0; min 0 int ans=0; ans 0 int tmp=0; tmp 0 int tmp_correct=0; tmp_correct 0 int tmp_taste=0; tmp_taste 0 boolean flag=true; flag true for(int i=0;i<N;i++){
      for(int j=0;j<N;j++){
        if(i==j){
          continue;
        }
        taste[i]+=apple[j];
      }
      tmp_correct=correct;
      tmp_taste=taste[i];
      if(correct<0){
        tmp_correct=-tmp_correct;
      }
      if(tmp_taste<0){
        tmp_taste=-tmp_taste;
      }
      tmp=tmp_correct-tmp_taste;
      if(tmp<0)tmp=-tmp;
      if(flag){
        min=tmp;
        ans=taste[i];
        flag=false;
      }
      if(min>tmp){
        min=tmp;
        ans=taste[i];
      }
      // System.out.println("correct:"+correct);
      // System.out.println("taste["+i+"]"+taste[i]);
      // System.out.println("eat"+tmp);
    } int i=0; int i=0; i 0 i<N i N i++ i++ i {
      for(int j=0;j<N;j++){
        if(i==j){
          continue;
        }
        taste[i]+=apple[j];
      }
      tmp_correct=correct;
      tmp_taste=taste[i];
      if(correct<0){
        tmp_correct=-tmp_correct;
      }
      if(tmp_taste<0){
        tmp_taste=-tmp_taste;
      }
      tmp=tmp_correct-tmp_taste;
      if(tmp<0)tmp=-tmp;
      if(flag){
        min=tmp;
        ans=taste[i];
        flag=false;
      }
      if(min>tmp){
        min=tmp;
        ans=taste[i];
      }
      // System.out.println("correct:"+correct);
      // System.out.println("taste["+i+"]"+taste[i]);
      // System.out.println("eat"+tmp);
    } {
      for(int j=0;j<N;j++){
        if(i==j){
          continue;
        }
        taste[i]+=apple[j];
      }
      tmp_correct=correct;
      tmp_taste=taste[i];
      if(correct<0){
        tmp_correct=-tmp_correct;
      }
      if(tmp_taste<0){
        tmp_taste=-tmp_taste;
      }
      tmp=tmp_correct-tmp_taste;
      if(tmp<0)tmp=-tmp;
      if(flag){
        min=tmp;
        ans=taste[i];
        flag=false;
      }
      if(min>tmp){
        min=tmp;
        ans=taste[i];
      }
      // System.out.println("correct:"+correct);
      // System.out.println("taste["+i+"]"+taste[i]);
      // System.out.println("eat"+tmp);
    } for(int j=0;j<N;j++){
        if(i==j){
          continue;
        }
        taste[i]+=apple[j];
      } int j=0; int j=0; j 0 j<N j N j++ j++ j {
        if(i==j){
          continue;
        }
        taste[i]+=apple[j];
      } {
        if(i==j){
          continue;
        }
        taste[i]+=apple[j];
      } if(i==j){
          continue;
        } i==j i j {
          continue;
        } continue; taste[i]+=apple[j] taste[i] taste i apple[j] apple j tmp_correct=correct tmp_correct correct tmp_taste=taste[i] tmp_taste taste[i] taste i if(correct<0){
        tmp_correct=-tmp_correct;
      } correct<0 correct 0 {
        tmp_correct=-tmp_correct;
      } tmp_correct=-tmp_correct tmp_correct -tmp_correct tmp_correct if(tmp_taste<0){
        tmp_taste=-tmp_taste;
      } tmp_taste<0 tmp_taste 0 {
        tmp_taste=-tmp_taste;
      } tmp_taste=-tmp_taste tmp_taste -tmp_taste tmp_taste tmp=tmp_correct-tmp_taste tmp tmp_correct-tmp_taste tmp_correct tmp_taste if(tmp<0)tmp=-tmp; tmp<0 tmp 0 tmp=-tmp tmp -tmp tmp if(flag){
        min=tmp;
        ans=taste[i];
        flag=false;
      } flag {
        min=tmp;
        ans=taste[i];
        flag=false;
      } min=tmp min tmp ans=taste[i] ans taste[i] taste i flag=false flag false if(min>tmp){
        min=tmp;
        ans=taste[i];
      } min>tmp min tmp {
        min=tmp;
        ans=taste[i];
      } min=tmp min tmp ans=taste[i] ans taste[i] taste i 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 scan=new Scanner(System.in);
    int N=scan.nextInt();
    int L=scan.nextInt();
    int[] apple=new int[N];
    int correct=0;
    for(int i=0;i<N;i++){
      apple[i]=L+i;
      correct+=apple[i];
    }
    int[] taste=new int[N];
    int min=0;
    int ans=0;
    int tmp=0;
    int tmp_correct=0;
    int tmp_taste=0;
    boolean flag=true;
    for(int i=0;i<N;i++){
      for(int j=0;j<N;j++){
        if(i==j){
          continue;
        }
        taste[i]+=apple[j];
      }
      tmp_correct=correct;
      tmp_taste=taste[i];
      if(correct<0){
        tmp_correct=-tmp_correct;
      }
      if(tmp_taste<0){
        tmp_taste=-tmp_taste;
      }
      tmp=tmp_correct-tmp_taste;
      if(tmp<0)tmp=-tmp;
      if(flag){
        min=tmp;
        ans=taste[i];
        flag=false;
      }
      if(min>tmp){
        min=tmp;
        ans=taste[i];
      }
      // System.out.println("correct:"+correct);
      // System.out.println("taste["+i+"]"+taste[i]);
      // System.out.println("eat"+tmp);
    }
    System.out.println(ans);
  }
}