import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(System.out);

        int n = in.nextInt();
        int l = in.nextInt();
        int sum = 0;
        int first = l;
        int last = l + n - 1;
        boolean zero = false;
        for (int i = 1; i <= n; i++) {
            zero = zero || (l + i - 1 == 0);
            sum += l + i - 1;
        }

        if (zero) out.println(sum);
        else {
            if (Math.abs(sum - last) > Math.abs(sum -first)) out.println(sum - last);
            else out.println(sum - first);
        }

        out.close();
    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main {

    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(System.out);

        int n = in.nextInt();
        int l = in.nextInt();
        int sum = 0;
        int first = l;
        int last = l + n - 1;
        boolean zero = false;
        for (int i = 1; i <= n; i++) {
            zero = zero || (l + i - 1 == 0);
            sum += l + i - 1;
        }

        if (zero) out.println(sum);
        else {
            if (Math.abs(sum - last) > Math.abs(sum -first)) out.println(sum - last);
            else out.println(sum - first);
        }

        out.close();
    }
} Main public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(System.out);

        int n = in.nextInt();
        int l = in.nextInt();
        int sum = 0;
        int first = l;
        int last = l + n - 1;
        boolean zero = false;
        for (int i = 1; i <= n; i++) {
            zero = zero || (l + i - 1 == 0);
            sum += l + i - 1;
        }

        if (zero) out.println(sum);
        else {
            if (Math.abs(sum - last) > Math.abs(sum -first)) out.println(sum - last);
            else out.println(sum - first);
        }

        out.close();
    } main {
        InputStream inputStream = System.in;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(System.out);

        int n = in.nextInt();
        int l = in.nextInt();
        int sum = 0;
        int first = l;
        int last = l + n - 1;
        boolean zero = false;
        for (int i = 1; i <= n; i++) {
            zero = zero || (l + i - 1 == 0);
            sum += l + i - 1;
        }

        if (zero) out.println(sum);
        else {
            if (Math.abs(sum - last) > Math.abs(sum -first)) out.println(sum - last);
            else out.println(sum - first);
        }

        out.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in Scanner in = new Scanner(inputStream); in new Scanner(inputStream) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) int n = in.nextInt(); n in.nextInt() in.nextInt in int l = in.nextInt(); l in.nextInt() in.nextInt in int sum = 0; sum 0 int first = l; first l int last = l + n - 1; last l + n - 1 l + n l n 1 boolean zero = false; zero false for (int i = 1; i <= n; i++) {
            zero = zero || (l + i - 1 == 0);
            sum += l + i - 1;
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            zero = zero || (l + i - 1 == 0);
            sum += l + i - 1;
        } {
            zero = zero || (l + i - 1 == 0);
            sum += l + i - 1;
        } zero = zero || (l + i - 1 == 0) zero zero || (l + i - 1 == 0) zero (l + i - 1 == 0) l + i - 1 l + i l i 1 0 sum += l + i - 1 sum l + i - 1 l + i l i 1 if (zero) out.println(sum);
        else {
            if (Math.abs(sum - last) > Math.abs(sum -first)) out.println(sum - last);
            else out.println(sum - first);
        } zero out.println(sum) out.println out sum {
            if (Math.abs(sum - last) > Math.abs(sum -first)) out.println(sum - last);
            else out.println(sum - first);
        } if (Math.abs(sum - last) > Math.abs(sum -first)) out.println(sum - last);
            else out.println(sum - first); Math.abs(sum - last) > Math.abs(sum -first) Math.abs(sum - last) Math.abs Math sum - last sum last Math.abs(sum -first) Math.abs Math sum -first sum first out.println(sum - last) out.println out sum - last sum last out.println(sum - first) out.println out sum - first sum first out.close() out.close out String[] args args public class Main {

    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(System.out);

        int n = in.nextInt();
        int l = in.nextInt();
        int sum = 0;
        int first = l;
        int last = l + n - 1;
        boolean zero = false;
        for (int i = 1; i <= n; i++) {
            zero = zero || (l + i - 1 == 0);
            sum += l + i - 1;
        }

        if (zero) out.println(sum);
        else {
            if (Math.abs(sum - last) > Math.abs(sum -first)) out.println(sum - last);
            else out.println(sum - first);
        }

        out.close();
    }
} public class Main {

    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(System.out);

        int n = in.nextInt();
        int l = in.nextInt();
        int sum = 0;
        int first = l;
        int last = l + n - 1;
        boolean zero = false;
        for (int i = 1; i <= n; i++) {
            zero = zero || (l + i - 1 == 0);
            sum += l + i - 1;
        }

        if (zero) out.println(sum);
        else {
            if (Math.abs(sum - last) > Math.abs(sum -first)) out.println(sum - last);
            else out.println(sum - first);
        }

        out.close();
    }
} Main
import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(System.out);

        int n = in.nextInt();
        int l = in.nextInt();
        int sum = 0;
        int first = l;
        int last = l + n - 1;
        boolean zero = false;
        for (int i = 1; i <= n; i++) {
            zero = zero || (l + i - 1 == 0);
            sum += l + i - 1;
        }

        if (zero) out.println(sum);
        else {
            if (Math.abs(sum - last) > Math.abs(sum -first)) out.println(sum - last);
            else out.println(sum - first);
        }

        out.close();
    }
}