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 ans = 0;
    boolean zero = false;
    int min = 50000;
    int max = -50000;
    for (int i=1;i<=N;i++){
      ans += i + L-1;
      
      min = Math.min(min,(i+L-1));
      max = Math.max(max,(i+L-1));
      if ((i+L-1) == 0){
        zero = true;
      }
    }
    
    if (zero){
     
    }else{
      if (Math.abs(min) <= Math.abs(max)){
        ans -= min;
      }else{
        ans -= max;
      }
    }
    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 ans = 0;
    boolean zero = false;
    int min = 50000;
    int max = -50000;
    for (int i=1;i<=N;i++){
      ans += i + L-1;
      
      min = Math.min(min,(i+L-1));
      max = Math.max(max,(i+L-1));
      if ((i+L-1) == 0){
        zero = true;
      }
    }
    
    if (zero){
     
    }else{
      if (Math.abs(min) <= Math.abs(max)){
        ans -= min;
      }else{
        ans -= max;
      }
    }
    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 ans = 0;
    boolean zero = false;
    int min = 50000;
    int max = -50000;
    for (int i=1;i<=N;i++){
      ans += i + L-1;
      
      min = Math.min(min,(i+L-1));
      max = Math.max(max,(i+L-1));
      if ((i+L-1) == 0){
        zero = true;
      }
    }
    
    if (zero){
     
    }else{
      if (Math.abs(min) <= Math.abs(max)){
        ans -= min;
      }else{
        ans -= max;
      }
    }
    System.out.println(ans);
    
  } main {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int L = sc.nextInt();
    int ans = 0;
    boolean zero = false;
    int min = 50000;
    int max = -50000;
    for (int i=1;i<=N;i++){
      ans += i + L-1;
      
      min = Math.min(min,(i+L-1));
      max = Math.max(max,(i+L-1));
      if ((i+L-1) == 0){
        zero = true;
      }
    }
    
    if (zero){
     
    }else{
      if (Math.abs(min) <= Math.abs(max)){
        ans -= min;
      }else{
        ans -= max;
      }
    }
    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 ans = 0; ans 0 boolean zero = false; zero false int min = 50000; min 50000 int max = -50000; max -50000 50000 for (int i=1;i<=N;i++){
      ans += i + L-1;
      
      min = Math.min(min,(i+L-1));
      max = Math.max(max,(i+L-1));
      if ((i+L-1) == 0){
        zero = true;
      }
    } int i=1; int i=1; i 1 i<=N i N i++ i++ i {
      ans += i + L-1;
      
      min = Math.min(min,(i+L-1));
      max = Math.max(max,(i+L-1));
      if ((i+L-1) == 0){
        zero = true;
      }
    } {
      ans += i + L-1;
      
      min = Math.min(min,(i+L-1));
      max = Math.max(max,(i+L-1));
      if ((i+L-1) == 0){
        zero = true;
      }
    } ans += i + L-1 ans i + L-1 i + L i L 1 min = Math.min(min,(i+L-1)) min Math.min(min,(i+L-1)) Math.min Math min (i+L-1) i+L i L 1 max = Math.max(max,(i+L-1)) max Math.max(max,(i+L-1)) Math.max Math max (i+L-1) i+L i L 1 if ((i+L-1) == 0){
        zero = true;
      } (i+L-1) == 0 (i+L-1) i+L i L 1 0 {
        zero = true;
      } zero = true zero true if (zero){
     
    }else{
      if (Math.abs(min) <= Math.abs(max)){
        ans -= min;
      }else{
        ans -= max;
      }
    } zero {
     
    } {
      if (Math.abs(min) <= Math.abs(max)){
        ans -= min;
      }else{
        ans -= max;
      }
    } if (Math.abs(min) <= Math.abs(max)){
        ans -= min;
      }else{
        ans -= max;
      } Math.abs(min) <= Math.abs(max) Math.abs(min) Math.abs Math min Math.abs(max) Math.abs Math max {
        ans -= min;
      } ans -= min ans min {
        ans -= max;
      } ans -= max ans max 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 ans = 0;
    boolean zero = false;
    int min = 50000;
    int max = -50000;
    for (int i=1;i<=N;i++){
      ans += i + L-1;
      
      min = Math.min(min,(i+L-1));
      max = Math.max(max,(i+L-1));
      if ((i+L-1) == 0){
        zero = true;
      }
    }
    
    if (zero){
     
    }else{
      if (Math.abs(min) <= Math.abs(max)){
        ans -= min;
      }else{
        ans -= max;
      }
    }
    System.out.println(ans);
    
  }
}