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 sum = N * (N + 1) / 2 + N * (L - 1);
    if (L >= 0) sum -= L;
    else if (L + N - 1 <= 0) sum -= L + N - 1;
    System.out.println(sum);
  }
} 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 sum = N * (N + 1) / 2 + N * (L - 1);
    if (L >= 0) sum -= L;
    else if (L + N - 1 <= 0) sum -= L + N - 1;
    System.out.println(sum);
  }
} Main public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int L = scanner.nextInt();
    int sum = N * (N + 1) / 2 + N * (L - 1);
    if (L >= 0) sum -= L;
    else if (L + N - 1 <= 0) sum -= L + N - 1;
    System.out.println(sum);
  } main {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int L = scanner.nextInt();
    int sum = N * (N + 1) / 2 + N * (L - 1);
    if (L >= 0) sum -= L;
    else if (L + N - 1 <= 0) sum -= L + N - 1;
    System.out.println(sum);
  } 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 sum = N * (N + 1) / 2 + N * (L - 1); sum N * (N + 1) / 2 + N * (L - 1) N * (N + 1) / 2 N * (N + 1) N (N + 1) N 1 2 N * (L - 1) N (L - 1) L 1 if (L >= 0) sum -= L;
    else if (L + N - 1 <= 0) sum -= L + N - 1; L >= 0 L 0 sum -= L sum L if (L + N - 1 <= 0) sum -= L + N - 1; L + N - 1 <= 0 L + N - 1 L + N L N 1 0 sum -= L + N - 1 sum L + N - 1 L + N L N 1 System.out.println(sum) System.out.println System.out System System.out sum 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 sum = N * (N + 1) / 2 + N * (L - 1);
    if (L >= 0) sum -= L;
    else if (L + N - 1 <= 0) sum -= L + N - 1;
    System.out.println(sum);
  }
} public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int L = scanner.nextInt();
    int sum = N * (N + 1) / 2 + N * (L - 1);
    if (L >= 0) sum -= L;
    else if (L + N - 1 <= 0) sum -= L + N - 1;
    System.out.println(sum);
  }
} 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 sum = N * (N + 1) / 2 + N * (L - 1);
    if (L >= 0) sum -= L;
    else if (L + N - 1 <= 0) sum -= L + N - 1;
    System.out.println(sum);
  }
}
