import java.util.*;
class Main {
  static Scanner sc = new Scanner(System.in);
  static int n = Integer.parseInt(sc.next());
  static int l = Integer.parseInt(sc.next());
  
  public static int appleToEat(int n, int l){
    int sum = 0;
    
    for (int i = 0; i < n; i++) {
        sum += (l + i);
    }
    
    if (l >= 0) {
      return sum - l;
    } else if (l*-1 >= n) {
      return sum - (l+n-1);
    } else {
      return sum;
    }
    
  }
  
  public static void main(String args[]) {
    int result = appleToEat(n, l);
    System.out.println(result);
    
  }
  
} import java.util.*; util.* java class Main {
  static Scanner sc = new Scanner(System.in);
  static int n = Integer.parseInt(sc.next());
  static int l = Integer.parseInt(sc.next());
  
  public static int appleToEat(int n, int l){
    int sum = 0;
    
    for (int i = 0; i < n; i++) {
        sum += (l + i);
    }
    
    if (l >= 0) {
      return sum - l;
    } else if (l*-1 >= n) {
      return sum - (l+n-1);
    } else {
      return sum;
    }
    
  }
  
  public static void main(String args[]) {
    int result = appleToEat(n, l);
    System.out.println(result);
    
  }
  
} Main static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) static int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc static int l = Integer.parseInt(sc.next()); l Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc public static int appleToEat(int n, int l){
    int sum = 0;
    
    for (int i = 0; i < n; i++) {
        sum += (l + i);
    }
    
    if (l >= 0) {
      return sum - l;
    } else if (l*-1 >= n) {
      return sum - (l+n-1);
    } else {
      return sum;
    }
    
  } appleToEat {
    int sum = 0;
    
    for (int i = 0; i < n; i++) {
        sum += (l + i);
    }
    
    if (l >= 0) {
      return sum - l;
    } else if (l*-1 >= n) {
      return sum - (l+n-1);
    } else {
      return sum;
    }
    
  } int sum = 0; sum 0 for (int i = 0; i < n; i++) {
        sum += (l + i);
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
        sum += (l + i);
    } {
        sum += (l + i);
    } sum += (l + i) sum (l + i) l i if (l >= 0) {
      return sum - l;
    } else if (l*-1 >= n) {
      return sum - (l+n-1);
    } else {
      return sum;
    } l >= 0 l 0 {
      return sum - l;
    } return sum - l; sum - l sum l if (l*-1 >= n) {
      return sum - (l+n-1);
    } else {
      return sum;
    } l*-1 >= n l*-1 l -1 1 n {
      return sum - (l+n-1);
    } return sum - (l+n-1); sum - (l+n-1) sum (l+n-1) l+n l n 1 {
      return sum;
    } return sum; sum int n n int l l public static void main(String args[]) {
    int result = appleToEat(n, l);
    System.out.println(result);
    
  } main {
    int result = appleToEat(n, l);
    System.out.println(result);
    
  } int result = appleToEat(n, l); result appleToEat(n, l) appleToEat n l System.out.println(result) System.out.println System.out System System.out result String args[] args
import java.util.*;
class Main {
  static Scanner sc = new Scanner(System.in);
  static int n = Integer.parseInt(sc.next());
  static int l = Integer.parseInt(sc.next());
  
  public static int appleToEat(int n, int l){
    int sum = 0;
    
    for (int i = 0; i < n; i++) {
        sum += (l + i);
    }
    
    if (l >= 0) {
      return sum - l;
    } else if (l*-1 >= n) {
      return sum - (l+n-1);
    } else {
      return sum;
    }
    
  }
  
  public static void main(String args[]) {
    int result = appleToEat(n, l);
    System.out.println(result);
    
  }
  
}