
import java.util.Scanner;

/**
 * @author author
 *
 */
public class Main {

  /**
   * @param args
   */
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int l = Integer.parseInt(sc.next());
    
    
    int sum = 0;
    int min = Math.abs(1 + l - 1);
    for (int j = 1; j <= n; j++) {
      min = Math.min(Math.abs(j + l - 1), min);
      sum += j + l - 1;
    }
    if (sum < 0)
      System.out.println(sum + min);
    else
      System.out.println(sum - min);
  }

} import java.util.Scanner; Scanner java.util public class Main {

  /**
   * @param args
   */
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int l = Integer.parseInt(sc.next());
    
    
    int sum = 0;
    int min = Math.abs(1 + l - 1);
    for (int j = 1; j <= n; j++) {
      min = Math.min(Math.abs(j + l - 1), min);
      sum += j + l - 1;
    }
    if (sum < 0)
      System.out.println(sum + min);
    else
      System.out.println(sum - min);
  }

} Main /**
   * @param args
   */
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int l = Integer.parseInt(sc.next());
    
    
    int sum = 0;
    int min = Math.abs(1 + l - 1);
    for (int j = 1; j <= n; j++) {
      min = Math.min(Math.abs(j + l - 1), min);
      sum += j + l - 1;
    }
    if (sum < 0)
      System.out.println(sum + min);
    else
      System.out.println(sum - min);
  } main {

    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int l = Integer.parseInt(sc.next());
    
    
    int sum = 0;
    int min = Math.abs(1 + l - 1);
    for (int j = 1; j <= n; j++) {
      min = Math.min(Math.abs(j + l - 1), min);
      sum += j + l - 1;
    }
    if (sum < 0)
      System.out.println(sum + min);
    else
      System.out.println(sum - min);
  } 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 int sum = 0; sum 0 int min = Math.abs(1 + l - 1); min Math.abs(1 + l - 1) Math.abs Math 1 + l - 1 1 + l 1 l 1 for (int j = 1; j <= n; j++) {
      min = Math.min(Math.abs(j + l - 1), min);
      sum += j + l - 1;
    } int j = 1; int j = 1; j 1 j <= n j n j++ j++ j {
      min = Math.min(Math.abs(j + l - 1), min);
      sum += j + l - 1;
    } {
      min = Math.min(Math.abs(j + l - 1), min);
      sum += j + l - 1;
    } min = Math.min(Math.abs(j + l - 1), min) min Math.min(Math.abs(j + l - 1), min) Math.min Math Math.abs(j + l - 1) Math.abs Math j + l - 1 j + l j l 1 min sum += j + l - 1 sum j + l - 1 j + l j l 1 if (sum < 0)
      System.out.println(sum + min);
    else
      System.out.println(sum - min); sum < 0 sum 0 System.out.println(sum + min) System.out.println System.out System System.out sum + min sum min System.out.println(sum - min) System.out.println System.out System System.out sum - min sum min String[] args args public class Main {

  /**
   * @param args
   */
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int l = Integer.parseInt(sc.next());
    
    
    int sum = 0;
    int min = Math.abs(1 + l - 1);
    for (int j = 1; j <= n; j++) {
      min = Math.min(Math.abs(j + l - 1), min);
      sum += j + l - 1;
    }
    if (sum < 0)
      System.out.println(sum + min);
    else
      System.out.println(sum - min);
  }

} public class Main {

  /**
   * @param args
   */
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int l = Integer.parseInt(sc.next());
    
    
    int sum = 0;
    int min = Math.abs(1 + l - 1);
    for (int j = 1; j <= n; j++) {
      min = Math.min(Math.abs(j + l - 1), min);
      sum += j + l - 1;
    }
    if (sum < 0)
      System.out.println(sum + min);
    else
      System.out.println(sum - min);
  }

} Main

import java.util.Scanner;

/**
 * @author author
 *
 */
public class Main {

  /**
   * @param args
   */
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int l = Integer.parseInt(sc.next());
    
    
    int sum = 0;
    int min = Math.abs(1 + l - 1);
    for (int j = 1; j <= n; j++) {
      min = Math.min(Math.abs(j + l - 1), min);
      sum += j + l - 1;
    }
    if (sum < 0)
      System.out.println(sum + min);
    else
      System.out.println(sum - min);
  }

}
