import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N, L;
        N = scan.nextInt();
        L = scan.nextInt();
        int[] apple = new int[N];
        if (L > 0) {
            for (int i = 0; i < N; i++) {
                apple[i] = L + (i + 1) - 1;
            }
            quick_sort(apple, 0, N - 1);
            int taste = 0;
            for (int i = 1; i < N; i++) {
                taste += apple[i];
            }
            System.out.println(taste);
        } else {
            int taste = 0;
            int index = 0;
            for (int i = 0; i < N; i++) {
                apple[i] = L + (i + 1) - 1;
            }
            int[] copyapple = new int[N];
            for (int i = 0; i < N; i++) {
                copyapple[i] = (int) Math.abs(L + (i + 1) - 1);
            }
            quick_sort(copyapple, 0, N - 1);
            if (copyapple[0] == 0) {
                for (int i = 0; i < N; i++) {
                    if (apple[i] != 0) {
                        taste += apple[i];
                    }
                }
            } else {
                quick_sort(apple, 0, N - 1);
                for (int i = 0; i < N - 1; i++) {
                    taste += apple[i];
                }
            }
            System.out.println(taste);
        }
    }

    static void quick_sort(int[] d, int left, int right) {
        if (left >= right) {
            return;
        }
        int p = d[(left + right) / 2];
        int l = left, r = right, tmp;
        while (l <= r) {
            while (d[l] < p) {
                l++;
            }
            while (d[r] > p) {
                r--;
            }
            if (l <= r) {
                tmp = d[l];
                d[l] = d[r];
                d[r] = tmp;
                l++;
                r--;
            }
        }
        quick_sort(d, left, r);
        quick_sort(d, l, right);
    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N, L;
        N = scan.nextInt();
        L = scan.nextInt();
        int[] apple = new int[N];
        if (L > 0) {
            for (int i = 0; i < N; i++) {
                apple[i] = L + (i + 1) - 1;
            }
            quick_sort(apple, 0, N - 1);
            int taste = 0;
            for (int i = 1; i < N; i++) {
                taste += apple[i];
            }
            System.out.println(taste);
        } else {
            int taste = 0;
            int index = 0;
            for (int i = 0; i < N; i++) {
                apple[i] = L + (i + 1) - 1;
            }
            int[] copyapple = new int[N];
            for (int i = 0; i < N; i++) {
                copyapple[i] = (int) Math.abs(L + (i + 1) - 1);
            }
            quick_sort(copyapple, 0, N - 1);
            if (copyapple[0] == 0) {
                for (int i = 0; i < N; i++) {
                    if (apple[i] != 0) {
                        taste += apple[i];
                    }
                }
            } else {
                quick_sort(apple, 0, N - 1);
                for (int i = 0; i < N - 1; i++) {
                    taste += apple[i];
                }
            }
            System.out.println(taste);
        }
    }

    static void quick_sort(int[] d, int left, int right) {
        if (left >= right) {
            return;
        }
        int p = d[(left + right) / 2];
        int l = left, r = right, tmp;
        while (l <= r) {
            while (d[l] < p) {
                l++;
            }
            while (d[r] > p) {
                r--;
            }
            if (l <= r) {
                tmp = d[l];
                d[l] = d[r];
                d[r] = tmp;
                l++;
                r--;
            }
        }
        quick_sort(d, left, r);
        quick_sort(d, l, right);
    }
} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N, L;
        N = scan.nextInt();
        L = scan.nextInt();
        int[] apple = new int[N];
        if (L > 0) {
            for (int i = 0; i < N; i++) {
                apple[i] = L + (i + 1) - 1;
            }
            quick_sort(apple, 0, N - 1);
            int taste = 0;
            for (int i = 1; i < N; i++) {
                taste += apple[i];
            }
            System.out.println(taste);
        } else {
            int taste = 0;
            int index = 0;
            for (int i = 0; i < N; i++) {
                apple[i] = L + (i + 1) - 1;
            }
            int[] copyapple = new int[N];
            for (int i = 0; i < N; i++) {
                copyapple[i] = (int) Math.abs(L + (i + 1) - 1);
            }
            quick_sort(copyapple, 0, N - 1);
            if (copyapple[0] == 0) {
                for (int i = 0; i < N; i++) {
                    if (apple[i] != 0) {
                        taste += apple[i];
                    }
                }
            } else {
                quick_sort(apple, 0, N - 1);
                for (int i = 0; i < N - 1; i++) {
                    taste += apple[i];
                }
            }
            System.out.println(taste);
        }
    } main {
        Scanner scan = new Scanner(System.in);
        int N, L;
        N = scan.nextInt();
        L = scan.nextInt();
        int[] apple = new int[N];
        if (L > 0) {
            for (int i = 0; i < N; i++) {
                apple[i] = L + (i + 1) - 1;
            }
            quick_sort(apple, 0, N - 1);
            int taste = 0;
            for (int i = 1; i < N; i++) {
                taste += apple[i];
            }
            System.out.println(taste);
        } else {
            int taste = 0;
            int index = 0;
            for (int i = 0; i < N; i++) {
                apple[i] = L + (i + 1) - 1;
            }
            int[] copyapple = new int[N];
            for (int i = 0; i < N; i++) {
                copyapple[i] = (int) Math.abs(L + (i + 1) - 1);
            }
            quick_sort(copyapple, 0, N - 1);
            if (copyapple[0] == 0) {
                for (int i = 0; i < N; i++) {
                    if (apple[i] != 0) {
                        taste += apple[i];
                    }
                }
            } else {
                quick_sort(apple, 0, N - 1);
                for (int i = 0; i < N - 1; i++) {
                    taste += apple[i];
                }
            }
            System.out.println(taste);
        }
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int N N L; L N = scan.nextInt() N scan.nextInt() scan.nextInt scan L = scan.nextInt() L scan.nextInt() scan.nextInt scan int[] apple = new int[N]; apple new int[N] N if (L > 0) {
            for (int i = 0; i < N; i++) {
                apple[i] = L + (i + 1) - 1;
            }
            quick_sort(apple, 0, N - 1);
            int taste = 0;
            for (int i = 1; i < N; i++) {
                taste += apple[i];
            }
            System.out.println(taste);
        } else {
            int taste = 0;
            int index = 0;
            for (int i = 0; i < N; i++) {
                apple[i] = L + (i + 1) - 1;
            }
            int[] copyapple = new int[N];
            for (int i = 0; i < N; i++) {
                copyapple[i] = (int) Math.abs(L + (i + 1) - 1);
            }
            quick_sort(copyapple, 0, N - 1);
            if (copyapple[0] == 0) {
                for (int i = 0; i < N; i++) {
                    if (apple[i] != 0) {
                        taste += apple[i];
                    }
                }
            } else {
                quick_sort(apple, 0, N - 1);
                for (int i = 0; i < N - 1; i++) {
                    taste += apple[i];
                }
            }
            System.out.println(taste);
        } L > 0 L 0 {
            for (int i = 0; i < N; i++) {
                apple[i] = L + (i + 1) - 1;
            }
            quick_sort(apple, 0, N - 1);
            int taste = 0;
            for (int i = 1; i < N; i++) {
                taste += apple[i];
            }
            System.out.println(taste);
        } for (int i = 0; i < N; i++) {
                apple[i] = L + (i + 1) - 1;
            } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
                apple[i] = L + (i + 1) - 1;
            } {
                apple[i] = L + (i + 1) - 1;
            } apple[i] = L + (i + 1) - 1 apple[i] apple i L + (i + 1) - 1 L + (i + 1) L (i + 1) i 1 1 quick_sort(apple, 0, N - 1) quick_sort apple 0 N - 1 N 1 int taste = 0; taste 0 for (int i = 1; i < N; i++) {
                taste += apple[i];
            } int i = 1; int i = 1; i 1 i < N i N i++ i++ i {
                taste += apple[i];
            } {
                taste += apple[i];
            } taste += apple[i] taste apple[i] apple i System.out.println(taste) System.out.println System.out System System.out taste {
            int taste = 0;
            int index = 0;
            for (int i = 0; i < N; i++) {
                apple[i] = L + (i + 1) - 1;
            }
            int[] copyapple = new int[N];
            for (int i = 0; i < N; i++) {
                copyapple[i] = (int) Math.abs(L + (i + 1) - 1);
            }
            quick_sort(copyapple, 0, N - 1);
            if (copyapple[0] == 0) {
                for (int i = 0; i < N; i++) {
                    if (apple[i] != 0) {
                        taste += apple[i];
                    }
                }
            } else {
                quick_sort(apple, 0, N - 1);
                for (int i = 0; i < N - 1; i++) {
                    taste += apple[i];
                }
            }
            System.out.println(taste);
        } int taste = 0; taste 0 int index = 0; index 0 for (int i = 0; i < N; i++) {
                apple[i] = L + (i + 1) - 1;
            } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
                apple[i] = L + (i + 1) - 1;
            } {
                apple[i] = L + (i + 1) - 1;
            } apple[i] = L + (i + 1) - 1 apple[i] apple i L + (i + 1) - 1 L + (i + 1) L (i + 1) i 1 1 int[] copyapple = new int[N]; copyapple new int[N] N for (int i = 0; i < N; i++) {
                copyapple[i] = (int) Math.abs(L + (i + 1) - 1);
            } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
                copyapple[i] = (int) Math.abs(L + (i + 1) - 1);
            } {
                copyapple[i] = (int) Math.abs(L + (i + 1) - 1);
            } copyapple[i] = (int) Math.abs(L + (i + 1) - 1) copyapple[i] copyapple i (int) Math.abs(L + (i + 1) - 1) Math.abs Math L + (i + 1) - 1 L + (i + 1) L (i + 1) i 1 1 quick_sort(copyapple, 0, N - 1) quick_sort copyapple 0 N - 1 N 1 if (copyapple[0] == 0) {
                for (int i = 0; i < N; i++) {
                    if (apple[i] != 0) {
                        taste += apple[i];
                    }
                }
            } else {
                quick_sort(apple, 0, N - 1);
                for (int i = 0; i < N - 1; i++) {
                    taste += apple[i];
                }
            } copyapple[0] == 0 copyapple[0] copyapple 0 0 {
                for (int i = 0; i < N; i++) {
                    if (apple[i] != 0) {
                        taste += apple[i];
                    }
                }
            } for (int i = 0; i < N; i++) {
                    if (apple[i] != 0) {
                        taste += apple[i];
                    }
                } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
                    if (apple[i] != 0) {
                        taste += apple[i];
                    }
                } {
                    if (apple[i] != 0) {
                        taste += apple[i];
                    }
                } if (apple[i] != 0) {
                        taste += apple[i];
                    } apple[i] != 0 apple[i] apple i 0 {
                        taste += apple[i];
                    } taste += apple[i] taste apple[i] apple i {
                quick_sort(apple, 0, N - 1);
                for (int i = 0; i < N - 1; i++) {
                    taste += apple[i];
                }
            } quick_sort(apple, 0, N - 1) quick_sort apple 0 N - 1 N 1 for (int i = 0; i < N - 1; i++) {
                    taste += apple[i];
                } int i = 0; int i = 0; i 0 i < N - 1 i N - 1 N 1 i++ i++ i {
                    taste += apple[i];
                } {
                    taste += apple[i];
                } taste += apple[i] taste apple[i] apple i System.out.println(taste) System.out.println System.out System System.out taste String[] args args static void quick_sort(int[] d, int left, int right) {
        if (left >= right) {
            return;
        }
        int p = d[(left + right) / 2];
        int l = left, r = right, tmp;
        while (l <= r) {
            while (d[l] < p) {
                l++;
            }
            while (d[r] > p) {
                r--;
            }
            if (l <= r) {
                tmp = d[l];
                d[l] = d[r];
                d[r] = tmp;
                l++;
                r--;
            }
        }
        quick_sort(d, left, r);
        quick_sort(d, l, right);
    } quick_sort {
        if (left >= right) {
            return;
        }
        int p = d[(left + right) / 2];
        int l = left, r = right, tmp;
        while (l <= r) {
            while (d[l] < p) {
                l++;
            }
            while (d[r] > p) {
                r--;
            }
            if (l <= r) {
                tmp = d[l];
                d[l] = d[r];
                d[r] = tmp;
                l++;
                r--;
            }
        }
        quick_sort(d, left, r);
        quick_sort(d, l, right);
    } if (left >= right) {
            return;
        } left >= right left right {
            return;
        } return; int p = d[(left + right) / 2]; p d[(left + right) / 2] d (left + right) / 2 (left + right) left right 2 int l = left l left r = right r right tmp; tmp while (l <= r) {
            while (d[l] < p) {
                l++;
            }
            while (d[r] > p) {
                r--;
            }
            if (l <= r) {
                tmp = d[l];
                d[l] = d[r];
                d[r] = tmp;
                l++;
                r--;
            }
        } l <= r l r {
            while (d[l] < p) {
                l++;
            }
            while (d[r] > p) {
                r--;
            }
            if (l <= r) {
                tmp = d[l];
                d[l] = d[r];
                d[r] = tmp;
                l++;
                r--;
            }
        } while (d[l] < p) {
                l++;
            } d[l] < p d[l] d l p {
                l++;
            } l++ l while (d[r] > p) {
                r--;
            } d[r] > p d[r] d r p {
                r--;
            } r-- r if (l <= r) {
                tmp = d[l];
                d[l] = d[r];
                d[r] = tmp;
                l++;
                r--;
            } l <= r l r {
                tmp = d[l];
                d[l] = d[r];
                d[r] = tmp;
                l++;
                r--;
            } tmp = d[l] tmp d[l] d l d[l] = d[r] d[l] d l d[r] d r d[r] = tmp d[r] d r tmp l++ l r-- r quick_sort(d, left, r) quick_sort d left r quick_sort(d, l, right) quick_sort d l right int[] d d int left left int right right public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N, L;
        N = scan.nextInt();
        L = scan.nextInt();
        int[] apple = new int[N];
        if (L > 0) {
            for (int i = 0; i < N; i++) {
                apple[i] = L + (i + 1) - 1;
            }
            quick_sort(apple, 0, N - 1);
            int taste = 0;
            for (int i = 1; i < N; i++) {
                taste += apple[i];
            }
            System.out.println(taste);
        } else {
            int taste = 0;
            int index = 0;
            for (int i = 0; i < N; i++) {
                apple[i] = L + (i + 1) - 1;
            }
            int[] copyapple = new int[N];
            for (int i = 0; i < N; i++) {
                copyapple[i] = (int) Math.abs(L + (i + 1) - 1);
            }
            quick_sort(copyapple, 0, N - 1);
            if (copyapple[0] == 0) {
                for (int i = 0; i < N; i++) {
                    if (apple[i] != 0) {
                        taste += apple[i];
                    }
                }
            } else {
                quick_sort(apple, 0, N - 1);
                for (int i = 0; i < N - 1; i++) {
                    taste += apple[i];
                }
            }
            System.out.println(taste);
        }
    }

    static void quick_sort(int[] d, int left, int right) {
        if (left >= right) {
            return;
        }
        int p = d[(left + right) / 2];
        int l = left, r = right, tmp;
        while (l <= r) {
            while (d[l] < p) {
                l++;
            }
            while (d[r] > p) {
                r--;
            }
            if (l <= r) {
                tmp = d[l];
                d[l] = d[r];
                d[r] = tmp;
                l++;
                r--;
            }
        }
        quick_sort(d, left, r);
        quick_sort(d, l, right);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N, L;
        N = scan.nextInt();
        L = scan.nextInt();
        int[] apple = new int[N];
        if (L > 0) {
            for (int i = 0; i < N; i++) {
                apple[i] = L + (i + 1) - 1;
            }
            quick_sort(apple, 0, N - 1);
            int taste = 0;
            for (int i = 1; i < N; i++) {
                taste += apple[i];
            }
            System.out.println(taste);
        } else {
            int taste = 0;
            int index = 0;
            for (int i = 0; i < N; i++) {
                apple[i] = L + (i + 1) - 1;
            }
            int[] copyapple = new int[N];
            for (int i = 0; i < N; i++) {
                copyapple[i] = (int) Math.abs(L + (i + 1) - 1);
            }
            quick_sort(copyapple, 0, N - 1);
            if (copyapple[0] == 0) {
                for (int i = 0; i < N; i++) {
                    if (apple[i] != 0) {
                        taste += apple[i];
                    }
                }
            } else {
                quick_sort(apple, 0, N - 1);
                for (int i = 0; i < N - 1; i++) {
                    taste += apple[i];
                }
            }
            System.out.println(taste);
        }
    }

    static void quick_sort(int[] d, int left, int right) {
        if (left >= right) {
            return;
        }
        int p = d[(left + right) / 2];
        int l = left, r = right, tmp;
        while (l <= r) {
            while (d[l] < p) {
                l++;
            }
            while (d[r] > p) {
                r--;
            }
            if (l <= r) {
                tmp = d[l];
                d[l] = d[r];
                d[r] = tmp;
                l++;
                r--;
            }
        }
        quick_sort(d, left, r);
        quick_sort(d, l, right);
    }
} Main
import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N, L;
        N = scan.nextInt();
        L = scan.nextInt();
        int[] apple = new int[N];
        if (L > 0) {
            for (int i = 0; i < N; i++) {
                apple[i] = L + (i + 1) - 1;
            }
            quick_sort(apple, 0, N - 1);
            int taste = 0;
            for (int i = 1; i < N; i++) {
                taste += apple[i];
            }
            System.out.println(taste);
        } else {
            int taste = 0;
            int index = 0;
            for (int i = 0; i < N; i++) {
                apple[i] = L + (i + 1) - 1;
            }
            int[] copyapple = new int[N];
            for (int i = 0; i < N; i++) {
                copyapple[i] = (int) Math.abs(L + (i + 1) - 1);
            }
            quick_sort(copyapple, 0, N - 1);
            if (copyapple[0] == 0) {
                for (int i = 0; i < N; i++) {
                    if (apple[i] != 0) {
                        taste += apple[i];
                    }
                }
            } else {
                quick_sort(apple, 0, N - 1);
                for (int i = 0; i < N - 1; i++) {
                    taste += apple[i];
                }
            }
            System.out.println(taste);
        }
    }

    static void quick_sort(int[] d, int left, int right) {
        if (left >= right) {
            return;
        }
        int p = d[(left + right) / 2];
        int l = left, r = right, tmp;
        while (l <= r) {
            while (d[l] < p) {
                l++;
            }
            while (d[r] > p) {
                r--;
            }
            if (l <= r) {
                tmp = d[l];
                d[l] = d[r];
                d[r] = tmp;
                l++;
                r--;
            }
        }
        quick_sort(d, left, r);
        quick_sort(d, l, right);
    }
}