import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);

        int n = stdIn.nextInt();
        int l = stdIn.nextInt();
        int[] t = new int[n]; // 味
        for (int i = 0; i < n; i++) {
            t[i] = l + i;
        }
        int min = Math.abs(t[0]);
        for (int i = 1; i < n; i++) {
            if (min > Math.abs(t[i]))
                min = Math.abs(t[i]);
        }
        int total = 0;
        for (int i = 0; i < n; i++) {
            total += t[i];
        }
        if (t[n - 1] < 0)
            System.out.println(total + min);
        else
            System.out.println(total - min);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);

        int n = stdIn.nextInt();
        int l = stdIn.nextInt();
        int[] t = new int[n]; // 味
        for (int i = 0; i < n; i++) {
            t[i] = l + i;
        }
        int min = Math.abs(t[0]);
        for (int i = 1; i < n; i++) {
            if (min > Math.abs(t[i]))
                min = Math.abs(t[i]);
        }
        int total = 0;
        for (int i = 0; i < n; i++) {
            total += t[i];
        }
        if (t[n - 1] < 0)
            System.out.println(total + min);
        else
            System.out.println(total - min);
    }
} Main public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);

        int n = stdIn.nextInt();
        int l = stdIn.nextInt();
        int[] t = new int[n]; // 味
        for (int i = 0; i < n; i++) {
            t[i] = l + i;
        }
        int min = Math.abs(t[0]);
        for (int i = 1; i < n; i++) {
            if (min > Math.abs(t[i]))
                min = Math.abs(t[i]);
        }
        int total = 0;
        for (int i = 0; i < n; i++) {
            total += t[i];
        }
        if (t[n - 1] < 0)
            System.out.println(total + min);
        else
            System.out.println(total - min);
    } main {
        Scanner stdIn = new Scanner(System.in);

        int n = stdIn.nextInt();
        int l = stdIn.nextInt();
        int[] t = new int[n]; // 味
        for (int i = 0; i < n; i++) {
            t[i] = l + i;
        }
        int min = Math.abs(t[0]);
        for (int i = 1; i < n; i++) {
            if (min > Math.abs(t[i]))
                min = Math.abs(t[i]);
        }
        int total = 0;
        for (int i = 0; i < n; i++) {
            total += t[i];
        }
        if (t[n - 1] < 0)
            System.out.println(total + min);
        else
            System.out.println(total - min);
    } Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int n = stdIn.nextInt(); n stdIn.nextInt() stdIn.nextInt stdIn int l = stdIn.nextInt(); l stdIn.nextInt() stdIn.nextInt stdIn int[] t = new int[n]; t new int[n] n for (int i = 0; i < n; i++) {
            t[i] = l + i;
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            t[i] = l + i;
        } {
            t[i] = l + i;
        } t[i] = l + i t[i] t i l + i l i int min = Math.abs(t[0]); min Math.abs(t[0]) Math.abs Math t[0] t 0 for (int i = 1; i < n; i++) {
            if (min > Math.abs(t[i]))
                min = Math.abs(t[i]);
        } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
            if (min > Math.abs(t[i]))
                min = Math.abs(t[i]);
        } {
            if (min > Math.abs(t[i]))
                min = Math.abs(t[i]);
        } if (min > Math.abs(t[i]))
                min = Math.abs(t[i]); min > Math.abs(t[i]) min Math.abs(t[i]) Math.abs Math t[i] t i min = Math.abs(t[i]) min Math.abs(t[i]) Math.abs Math t[i] t i int total = 0; total 0 for (int i = 0; i < n; i++) {
            total += t[i];
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            total += t[i];
        } {
            total += t[i];
        } total += t[i] total t[i] t i if (t[n - 1] < 0)
            System.out.println(total + min);
        else
            System.out.println(total - min); t[n - 1] < 0 t[n - 1] t n - 1 n 1 0 System.out.println(total + min) System.out.println System.out System System.out total + min total min System.out.println(total - min) System.out.println System.out System System.out total - min total min String[] args args public class Main {
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);

        int n = stdIn.nextInt();
        int l = stdIn.nextInt();
        int[] t = new int[n]; // 味
        for (int i = 0; i < n; i++) {
            t[i] = l + i;
        }
        int min = Math.abs(t[0]);
        for (int i = 1; i < n; i++) {
            if (min > Math.abs(t[i]))
                min = Math.abs(t[i]);
        }
        int total = 0;
        for (int i = 0; i < n; i++) {
            total += t[i];
        }
        if (t[n - 1] < 0)
            System.out.println(total + min);
        else
            System.out.println(total - min);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);

        int n = stdIn.nextInt();
        int l = stdIn.nextInt();
        int[] t = new int[n]; // 味
        for (int i = 0; i < n; i++) {
            t[i] = l + i;
        }
        int min = Math.abs(t[0]);
        for (int i = 1; i < n; i++) {
            if (min > Math.abs(t[i]))
                min = Math.abs(t[i]);
        }
        int total = 0;
        for (int i = 0; i < n; i++) {
            total += t[i];
        }
        if (t[n - 1] < 0)
            System.out.println(total + min);
        else
            System.out.println(total - min);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);

        int n = stdIn.nextInt();
        int l = stdIn.nextInt();
        int[] t = new int[n]; // 味
        for (int i = 0; i < n; i++) {
            t[i] = l + i;
        }
        int min = Math.abs(t[0]);
        for (int i = 1; i < n; i++) {
            if (min > Math.abs(t[i]))
                min = Math.abs(t[i]);
        }
        int total = 0;
        for (int i = 0; i < n; i++) {
            total += t[i];
        }
        if (t[n - 1] < 0)
            System.out.println(total + min);
        else
            System.out.println(total - min);
    }
}