import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws Exception {
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
            int[] array = readIntArray(reader);
            int N = array[0];
            int L = array[1];

            int S = 0;
            for (int i = 1; i <= N; i++) {
                S += L + i - 1;
            }

            if (L <= 0 && 0 <= L + N - 1) {
                System.out.println(S);
            } else if (Math.abs(L) <= Math.abs(L + N - 1)) {
                System.out.println(S - L);
            } else {
                System.out.println(S - L - N + 1);
            }
        }
    }

    public static int[] readIntArray(BufferedReader reader) throws Exception {
        String[] str = reader.readLine().split(" ");
        int[] array = new int[str.length];
        for (int i = 0; i < str.length; i++) {
            array[i] = Integer.parseInt(str[i]);
        }
        return array;
    }

} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

    public static void main(String[] args) throws Exception {
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
            int[] array = readIntArray(reader);
            int N = array[0];
            int L = array[1];

            int S = 0;
            for (int i = 1; i <= N; i++) {
                S += L + i - 1;
            }

            if (L <= 0 && 0 <= L + N - 1) {
                System.out.println(S);
            } else if (Math.abs(L) <= Math.abs(L + N - 1)) {
                System.out.println(S - L);
            } else {
                System.out.println(S - L - N + 1);
            }
        }
    }

    public static int[] readIntArray(BufferedReader reader) throws Exception {
        String[] str = reader.readLine().split(" ");
        int[] array = new int[str.length];
        for (int i = 0; i < str.length; i++) {
            array[i] = Integer.parseInt(str[i]);
        }
        return array;
    }

} Main public static void main(String[] args) throws Exception {
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
            int[] array = readIntArray(reader);
            int N = array[0];
            int L = array[1];

            int S = 0;
            for (int i = 1; i <= N; i++) {
                S += L + i - 1;
            }

            if (L <= 0 && 0 <= L + N - 1) {
                System.out.println(S);
            } else if (Math.abs(L) <= Math.abs(L + N - 1)) {
                System.out.println(S - L);
            } else {
                System.out.println(S - L - N + 1);
            }
        }
    } main {
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
            int[] array = readIntArray(reader);
            int N = array[0];
            int L = array[1];

            int S = 0;
            for (int i = 1; i <= N; i++) {
                S += L + i - 1;
            }

            if (L <= 0 && 0 <= L + N - 1) {
                System.out.println(S);
            } else if (Math.abs(L) <= Math.abs(L + N - 1)) {
                System.out.println(S - L);
            } else {
                System.out.println(S - L - N + 1);
            }
        }
    } try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
            int[] array = readIntArray(reader);
            int N = array[0];
            int L = array[1];

            int S = 0;
            for (int i = 1; i <= N; i++) {
                S += L + i - 1;
            }

            if (L <= 0 && 0 <= L + N - 1) {
                System.out.println(S);
            } else if (Math.abs(L) <= Math.abs(L + N - 1)) {
                System.out.println(S - L);
            } else {
                System.out.println(S - L - N + 1);
            }
        } {
            int[] array = readIntArray(reader);
            int N = array[0];
            int L = array[1];

            int S = 0;
            for (int i = 1; i <= N; i++) {
                S += L + i - 1;
            }

            if (L <= 0 && 0 <= L + N - 1) {
                System.out.println(S);
            } else if (Math.abs(L) <= Math.abs(L + N - 1)) {
                System.out.println(S - L);
            } else {
                System.out.println(S - L - N + 1);
            }
        } BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)) BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)) new BufferedReader(new InputStreamReader(System.in)) int[] array = readIntArray(reader); array readIntArray(reader) readIntArray reader int N = array[0]; N array[0] array 0 int L = array[1]; L array[1] array 1 int S = 0; S 0 for (int i = 1; i <= N; i++) {
                S += L + i - 1;
            } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
                S += L + i - 1;
            } {
                S += L + i - 1;
            } S += L + i - 1 S L + i - 1 L + i L i 1 if (L <= 0 && 0 <= L + N - 1) {
                System.out.println(S);
            } else if (Math.abs(L) <= Math.abs(L + N - 1)) {
                System.out.println(S - L);
            } else {
                System.out.println(S - L - N + 1);
            } L <= 0 && 0 <= L + N - 1 L <= 0 L 0 0 <= L + N - 1 0 L + N - 1 L + N L N 1 {
                System.out.println(S);
            } System.out.println(S) System.out.println System.out System System.out S if (Math.abs(L) <= Math.abs(L + N - 1)) {
                System.out.println(S - L);
            } else {
                System.out.println(S - L - N + 1);
            } Math.abs(L) <= Math.abs(L + N - 1) Math.abs(L) Math.abs Math L Math.abs(L + N - 1) Math.abs Math L + N - 1 L + N L N 1 {
                System.out.println(S - L);
            } System.out.println(S - L) System.out.println System.out System System.out S - L S L {
                System.out.println(S - L - N + 1);
            } System.out.println(S - L - N + 1) System.out.println System.out System System.out S - L - N + 1 S - L - N S - L - N S L N 1 String[] args args public static int[] readIntArray(BufferedReader reader) throws Exception {
        String[] str = reader.readLine().split(" ");
        int[] array = new int[str.length];
        for (int i = 0; i < str.length; i++) {
            array[i] = Integer.parseInt(str[i]);
        }
        return array;
    } readIntArray {
        String[] str = reader.readLine().split(" ");
        int[] array = new int[str.length];
        for (int i = 0; i < str.length; i++) {
            array[i] = Integer.parseInt(str[i]);
        }
        return array;
    } String[] str = reader.readLine().split(" "); str reader.readLine().split(" ") reader.readLine().split reader.readLine() reader.readLine reader " " int[] array = new int[str.length]; array new int[str.length] str.length str str.length for (int i = 0; i < str.length; i++) {
            array[i] = Integer.parseInt(str[i]);
        } int i = 0; int i = 0; i 0 i < str.length i str.length str str.length i++ i++ i {
            array[i] = Integer.parseInt(str[i]);
        } {
            array[i] = Integer.parseInt(str[i]);
        } array[i] = Integer.parseInt(str[i]) array[i] array i Integer.parseInt(str[i]) Integer.parseInt Integer str[i] str i return array; array BufferedReader reader reader public class Main {

    public static void main(String[] args) throws Exception {
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
            int[] array = readIntArray(reader);
            int N = array[0];
            int L = array[1];

            int S = 0;
            for (int i = 1; i <= N; i++) {
                S += L + i - 1;
            }

            if (L <= 0 && 0 <= L + N - 1) {
                System.out.println(S);
            } else if (Math.abs(L) <= Math.abs(L + N - 1)) {
                System.out.println(S - L);
            } else {
                System.out.println(S - L - N + 1);
            }
        }
    }

    public static int[] readIntArray(BufferedReader reader) throws Exception {
        String[] str = reader.readLine().split(" ");
        int[] array = new int[str.length];
        for (int i = 0; i < str.length; i++) {
            array[i] = Integer.parseInt(str[i]);
        }
        return array;
    }

} public class Main {

    public static void main(String[] args) throws Exception {
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
            int[] array = readIntArray(reader);
            int N = array[0];
            int L = array[1];

            int S = 0;
            for (int i = 1; i <= N; i++) {
                S += L + i - 1;
            }

            if (L <= 0 && 0 <= L + N - 1) {
                System.out.println(S);
            } else if (Math.abs(L) <= Math.abs(L + N - 1)) {
                System.out.println(S - L);
            } else {
                System.out.println(S - L - N + 1);
            }
        }
    }

    public static int[] readIntArray(BufferedReader reader) throws Exception {
        String[] str = reader.readLine().split(" ");
        int[] array = new int[str.length];
        for (int i = 0; i < str.length; i++) {
            array[i] = Integer.parseInt(str[i]);
        }
        return array;
    }

} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws Exception {
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
            int[] array = readIntArray(reader);
            int N = array[0];
            int L = array[1];

            int S = 0;
            for (int i = 1; i <= N; i++) {
                S += L + i - 1;
            }

            if (L <= 0 && 0 <= L + N - 1) {
                System.out.println(S);
            } else if (Math.abs(L) <= Math.abs(L + N - 1)) {
                System.out.println(S - L);
            } else {
                System.out.println(S - L - N + 1);
            }
        }
    }

    public static int[] readIntArray(BufferedReader reader) throws Exception {
        String[] str = reader.readLine().split(" ");
        int[] array = new int[str.length];
        for (int i = 0; i < str.length; i++) {
            array[i] = Integer.parseInt(str[i]);
        }
        return array;
    }

}
