import java.util.Scanner;

class Main {
    public static void main(final String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int L = scan.nextInt();

        int eat = Integer.MAX_VALUE;
        int eat_c = Integer.MAX_VALUE;
        int[] a = new int[N];
        int cnt = 0;
        for (int i = 1; i < N + 1; i++) {
            a[cnt] = L + i -1;
            int temp = 0;
            if (a[cnt] < 0 ) {
                temp = a[cnt] * -1;
            } else {
                temp = a[cnt];
            }

            int min = Math.min(eat_c, temp);
            if (min < eat_c) {
                eat =  a[cnt];
                eat_c =  min;
            }
            cnt++;
        }
        int count = 0;
        boolean eatFlag = false;
        for (int i = 0; i < N; i++) {
            if (a[i] == eat && !eatFlag) {
                eatFlag = true;
                continue;
            }
            count += a[i];
        }
        System.out.println(count);
    }
} import java.util.Scanner; Scanner java.util class Main {
    public static void main(final String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int L = scan.nextInt();

        int eat = Integer.MAX_VALUE;
        int eat_c = Integer.MAX_VALUE;
        int[] a = new int[N];
        int cnt = 0;
        for (int i = 1; i < N + 1; i++) {
            a[cnt] = L + i -1;
            int temp = 0;
            if (a[cnt] < 0 ) {
                temp = a[cnt] * -1;
            } else {
                temp = a[cnt];
            }

            int min = Math.min(eat_c, temp);
            if (min < eat_c) {
                eat =  a[cnt];
                eat_c =  min;
            }
            cnt++;
        }
        int count = 0;
        boolean eatFlag = false;
        for (int i = 0; i < N; i++) {
            if (a[i] == eat && !eatFlag) {
                eatFlag = true;
                continue;
            }
            count += a[i];
        }
        System.out.println(count);
    }
} Main public static void main(final String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int L = scan.nextInt();

        int eat = Integer.MAX_VALUE;
        int eat_c = Integer.MAX_VALUE;
        int[] a = new int[N];
        int cnt = 0;
        for (int i = 1; i < N + 1; i++) {
            a[cnt] = L + i -1;
            int temp = 0;
            if (a[cnt] < 0 ) {
                temp = a[cnt] * -1;
            } else {
                temp = a[cnt];
            }

            int min = Math.min(eat_c, temp);
            if (min < eat_c) {
                eat =  a[cnt];
                eat_c =  min;
            }
            cnt++;
        }
        int count = 0;
        boolean eatFlag = false;
        for (int i = 0; i < N; i++) {
            if (a[i] == eat && !eatFlag) {
                eatFlag = true;
                continue;
            }
            count += a[i];
        }
        System.out.println(count);
    } main {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int L = scan.nextInt();

        int eat = Integer.MAX_VALUE;
        int eat_c = Integer.MAX_VALUE;
        int[] a = new int[N];
        int cnt = 0;
        for (int i = 1; i < N + 1; i++) {
            a[cnt] = L + i -1;
            int temp = 0;
            if (a[cnt] < 0 ) {
                temp = a[cnt] * -1;
            } else {
                temp = a[cnt];
            }

            int min = Math.min(eat_c, temp);
            if (min < eat_c) {
                eat =  a[cnt];
                eat_c =  min;
            }
            cnt++;
        }
        int count = 0;
        boolean eatFlag = false;
        for (int i = 0; i < N; i++) {
            if (a[i] == eat && !eatFlag) {
                eatFlag = true;
                continue;
            }
            count += a[i];
        }
        System.out.println(count);
    } 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 eat = Integer.MAX_VALUE; eat Integer.MAX_VALUE Integer Integer.MAX_VALUE int eat_c = Integer.MAX_VALUE; eat_c Integer.MAX_VALUE Integer Integer.MAX_VALUE int[] a = new int[N]; a new int[N] N int cnt = 0; cnt 0 for (int i = 1; i < N + 1; i++) {
            a[cnt] = L + i -1;
            int temp = 0;
            if (a[cnt] < 0 ) {
                temp = a[cnt] * -1;
            } else {
                temp = a[cnt];
            }

            int min = Math.min(eat_c, temp);
            if (min < eat_c) {
                eat =  a[cnt];
                eat_c =  min;
            }
            cnt++;
        } int i = 1; int i = 1; i 1 i < N + 1 i N + 1 N 1 i++ i++ i {
            a[cnt] = L + i -1;
            int temp = 0;
            if (a[cnt] < 0 ) {
                temp = a[cnt] * -1;
            } else {
                temp = a[cnt];
            }

            int min = Math.min(eat_c, temp);
            if (min < eat_c) {
                eat =  a[cnt];
                eat_c =  min;
            }
            cnt++;
        } {
            a[cnt] = L + i -1;
            int temp = 0;
            if (a[cnt] < 0 ) {
                temp = a[cnt] * -1;
            } else {
                temp = a[cnt];
            }

            int min = Math.min(eat_c, temp);
            if (min < eat_c) {
                eat =  a[cnt];
                eat_c =  min;
            }
            cnt++;
        } a[cnt] = L + i -1 a[cnt] a cnt L + i -1 L + i L i 1 int temp = 0; temp 0 if (a[cnt] < 0 ) {
                temp = a[cnt] * -1;
            } else {
                temp = a[cnt];
            } a[cnt] < 0 a[cnt] a cnt 0 {
                temp = a[cnt] * -1;
            } temp = a[cnt] * -1 temp a[cnt] * -1 a[cnt] a cnt -1 1 {
                temp = a[cnt];
            } temp = a[cnt] temp a[cnt] a cnt int min = Math.min(eat_c, temp); min Math.min(eat_c, temp) Math.min Math eat_c temp if (min < eat_c) {
                eat =  a[cnt];
                eat_c =  min;
            } min < eat_c min eat_c {
                eat =  a[cnt];
                eat_c =  min;
            } eat =  a[cnt] eat a[cnt] a cnt eat_c =  min eat_c min cnt++ cnt int count = 0; count 0 boolean eatFlag = false; eatFlag false for (int i = 0; i < N; i++) {
            if (a[i] == eat && !eatFlag) {
                eatFlag = true;
                continue;
            }
            count += a[i];
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            if (a[i] == eat && !eatFlag) {
                eatFlag = true;
                continue;
            }
            count += a[i];
        } {
            if (a[i] == eat && !eatFlag) {
                eatFlag = true;
                continue;
            }
            count += a[i];
        } if (a[i] == eat && !eatFlag) {
                eatFlag = true;
                continue;
            } a[i] == eat && !eatFlag a[i] == eat a[i] a i eat !eatFlag eatFlag {
                eatFlag = true;
                continue;
            } eatFlag = true eatFlag true continue; count += a[i] count a[i] a i System.out.println(count) System.out.println System.out System System.out count final String[] args args
import java.util.Scanner;

class Main {
    public static void main(final String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int L = scan.nextInt();

        int eat = Integer.MAX_VALUE;
        int eat_c = Integer.MAX_VALUE;
        int[] a = new int[N];
        int cnt = 0;
        for (int i = 1; i < N + 1; i++) {
            a[cnt] = L + i -1;
            int temp = 0;
            if (a[cnt] < 0 ) {
                temp = a[cnt] * -1;
            } else {
                temp = a[cnt];
            }

            int min = Math.min(eat_c, temp);
            if (min < eat_c) {
                eat =  a[cnt];
                eat_c =  min;
            }
            cnt++;
        }
        int count = 0;
        boolean eatFlag = false;
        for (int i = 0; i < N; i++) {
            if (a[i] == eat && !eatFlag) {
                eatFlag = true;
                continue;
            }
            count += a[i];
        }
        System.out.println(count);
    }
}
