import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Washoum
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        inputClass in = new inputClass(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BBiteEating solver = new BBiteEating();
        solver.solve(1, in, out);
        out.close();
    }

    static class BBiteEating {
        public void solve(int testNumber, inputClass sc, PrintWriter out) {
            int n = sc.nextInt();
            int l = sc.nextInt();
            int sum = 0;
            for (int i = 0; i < n; i++) {
                sum += (l + i);
            }
            int diff = Math.abs(sum - (sum - l));
            int ans = sum - l;
            for (int i = 1; i < n; i++) {
                if (diff > Math.abs(sum - (sum - l - i))) {
                    ans = sum - l - i;
                    diff = Math.abs(sum - (sum - l - i));
                }
            }
            out.println(ans);
        }

    }

    static class inputClass {
        BufferedReader br;
        StringTokenizer st;

        public inputClass(InputStream in) {

            br = new BufferedReader(new InputStreamReader(in));
        }

        public String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}
 import java.io.OutputStream; OutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.StringTokenizer; StringTokenizer java.util import java.io.IOException; IOException java.io import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.InputStream; InputStream java.io public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        inputClass in = new inputClass(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BBiteEating solver = new BBiteEating();
        solver.solve(1, in, out);
        out.close();
    }

    static class BBiteEating {
        public void solve(int testNumber, inputClass sc, PrintWriter out) {
            int n = sc.nextInt();
            int l = sc.nextInt();
            int sum = 0;
            for (int i = 0; i < n; i++) {
                sum += (l + i);
            }
            int diff = Math.abs(sum - (sum - l));
            int ans = sum - l;
            for (int i = 1; i < n; i++) {
                if (diff > Math.abs(sum - (sum - l - i))) {
                    ans = sum - l - i;
                    diff = Math.abs(sum - (sum - l - i));
                }
            }
            out.println(ans);
        }

    }

    static class inputClass {
        BufferedReader br;
        StringTokenizer st;

        public inputClass(InputStream in) {

            br = new BufferedReader(new InputStreamReader(in));
        }

        public String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        inputClass in = new inputClass(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BBiteEating solver = new BBiteEating();
        solver.solve(1, in, out);
        out.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        inputClass in = new inputClass(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BBiteEating solver = new BBiteEating();
        solver.solve(1, in, out);
        out.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out inputClass in = new inputClass(inputStream); in new inputClass(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) BBiteEating solver = new BBiteEating(); solver new BBiteEating() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class BBiteEating {
        public void solve(int testNumber, inputClass sc, PrintWriter out) {
            int n = sc.nextInt();
            int l = sc.nextInt();
            int sum = 0;
            for (int i = 0; i < n; i++) {
                sum += (l + i);
            }
            int diff = Math.abs(sum - (sum - l));
            int ans = sum - l;
            for (int i = 1; i < n; i++) {
                if (diff > Math.abs(sum - (sum - l - i))) {
                    ans = sum - l - i;
                    diff = Math.abs(sum - (sum - l - i));
                }
            }
            out.println(ans);
        }

    } BBiteEating public void solve(int testNumber, inputClass sc, PrintWriter out) {
            int n = sc.nextInt();
            int l = sc.nextInt();
            int sum = 0;
            for (int i = 0; i < n; i++) {
                sum += (l + i);
            }
            int diff = Math.abs(sum - (sum - l));
            int ans = sum - l;
            for (int i = 1; i < n; i++) {
                if (diff > Math.abs(sum - (sum - l - i))) {
                    ans = sum - l - i;
                    diff = Math.abs(sum - (sum - l - i));
                }
            }
            out.println(ans);
        } solve {
            int n = sc.nextInt();
            int l = sc.nextInt();
            int sum = 0;
            for (int i = 0; i < n; i++) {
                sum += (l + i);
            }
            int diff = Math.abs(sum - (sum - l));
            int ans = sum - l;
            for (int i = 1; i < n; i++) {
                if (diff > Math.abs(sum - (sum - l - i))) {
                    ans = sum - l - i;
                    diff = Math.abs(sum - (sum - l - i));
                }
            }
            out.println(ans);
        } int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int l = sc.nextInt(); l sc.nextInt() sc.nextInt sc int sum = 0; sum 0 for (int i = 0; i < n; i++) {
                sum += (l + i);
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                sum += (l + i);
            } {
                sum += (l + i);
            } sum += (l + i) sum (l + i) l i int diff = Math.abs(sum - (sum - l)); diff Math.abs(sum - (sum - l)) Math.abs Math sum - (sum - l) sum (sum - l) sum l int ans = sum - l; ans sum - l sum l for (int i = 1; i < n; i++) {
                if (diff > Math.abs(sum - (sum - l - i))) {
                    ans = sum - l - i;
                    diff = Math.abs(sum - (sum - l - i));
                }
            } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
                if (diff > Math.abs(sum - (sum - l - i))) {
                    ans = sum - l - i;
                    diff = Math.abs(sum - (sum - l - i));
                }
            } {
                if (diff > Math.abs(sum - (sum - l - i))) {
                    ans = sum - l - i;
                    diff = Math.abs(sum - (sum - l - i));
                }
            } if (diff > Math.abs(sum - (sum - l - i))) {
                    ans = sum - l - i;
                    diff = Math.abs(sum - (sum - l - i));
                } diff > Math.abs(sum - (sum - l - i)) diff Math.abs(sum - (sum - l - i)) Math.abs Math sum - (sum - l - i) sum (sum - l - i) sum - l - i sum l i {
                    ans = sum - l - i;
                    diff = Math.abs(sum - (sum - l - i));
                } ans = sum - l - i ans sum - l - i sum - l - i sum l i diff = Math.abs(sum - (sum - l - i)) diff Math.abs(sum - (sum - l - i)) Math.abs Math sum - (sum - l - i) sum (sum - l - i) sum - l - i sum l i out.println(ans) out.println out ans int testNumber testNumber inputClass sc sc PrintWriter out out static class inputClass {
        BufferedReader br;
        StringTokenizer st;

        public inputClass(InputStream in) {

            br = new BufferedReader(new InputStreamReader(in));
        }

        public String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    } inputClass BufferedReader br; br StringTokenizer st; st public inputClass(InputStream in) {

            br = new BufferedReader(new InputStreamReader(in));
        } inputClass {

            br = new BufferedReader(new InputStreamReader(in));
        } br = new BufferedReader(new InputStreamReader(in)) br new BufferedReader(new InputStreamReader(in)) InputStream in in public String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        } next {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        } while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            } st == null || !st.hasMoreElements() st == null st null !st.hasMoreElements() st.hasMoreElements() st.hasMoreElements st {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            } try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();
                } IOException e {
                    e.printStackTrace();
                } e.printStackTrace() e.printStackTrace e {
                    st = new StringTokenizer(br.readLine());
                } st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return st.nextToken(); st.nextToken() st.nextToken st public int nextInt() {
            return Integer.parseInt(next());
        } nextInt {
            return Integer.parseInt(next());
        } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        inputClass in = new inputClass(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BBiteEating solver = new BBiteEating();
        solver.solve(1, in, out);
        out.close();
    }

    static class BBiteEating {
        public void solve(int testNumber, inputClass sc, PrintWriter out) {
            int n = sc.nextInt();
            int l = sc.nextInt();
            int sum = 0;
            for (int i = 0; i < n; i++) {
                sum += (l + i);
            }
            int diff = Math.abs(sum - (sum - l));
            int ans = sum - l;
            for (int i = 1; i < n; i++) {
                if (diff > Math.abs(sum - (sum - l - i))) {
                    ans = sum - l - i;
                    diff = Math.abs(sum - (sum - l - i));
                }
            }
            out.println(ans);
        }

    }

    static class inputClass {
        BufferedReader br;
        StringTokenizer st;

        public inputClass(InputStream in) {

            br = new BufferedReader(new InputStreamReader(in));
        }

        public String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
} public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        inputClass in = new inputClass(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BBiteEating solver = new BBiteEating();
        solver.solve(1, in, out);
        out.close();
    }

    static class BBiteEating {
        public void solve(int testNumber, inputClass sc, PrintWriter out) {
            int n = sc.nextInt();
            int l = sc.nextInt();
            int sum = 0;
            for (int i = 0; i < n; i++) {
                sum += (l + i);
            }
            int diff = Math.abs(sum - (sum - l));
            int ans = sum - l;
            for (int i = 1; i < n; i++) {
                if (diff > Math.abs(sum - (sum - l - i))) {
                    ans = sum - l - i;
                    diff = Math.abs(sum - (sum - l - i));
                }
            }
            out.println(ans);
        }

    }

    static class inputClass {
        BufferedReader br;
        StringTokenizer st;

        public inputClass(InputStream in) {

            br = new BufferedReader(new InputStreamReader(in));
        }

        public String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Washoum
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        inputClass in = new inputClass(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BBiteEating solver = new BBiteEating();
        solver.solve(1, in, out);
        out.close();
    }

    static class BBiteEating {
        public void solve(int testNumber, inputClass sc, PrintWriter out) {
            int n = sc.nextInt();
            int l = sc.nextInt();
            int sum = 0;
            for (int i = 0; i < n; i++) {
                sum += (l + i);
            }
            int diff = Math.abs(sum - (sum - l));
            int ans = sum - l;
            for (int i = 1; i < n; i++) {
                if (diff > Math.abs(sum - (sum - l - i))) {
                    ans = sum - l - i;
                    diff = Math.abs(sum - (sum - l - i));
                }
            }
            out.println(ans);
        }

    }

    static class inputClass {
        BufferedReader br;
        StringTokenizer st;

        public inputClass(InputStream in) {

            br = new BufferedReader(new InputStreamReader(in));
        }

        public String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

