import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();

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

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

        int total = l * n + n * (n - 1) / 2;
        if (l >= 0) {
            System.out.println(total - l);
        } else {
            if (Math.abs(l) < n) {
                System.out.println(total);
            } else {
                System.out.println(total - (l + n - 1));
            }
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();

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

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

        int total = l * n + n * (n - 1) / 2;
        if (l >= 0) {
            System.out.println(total - l);
        } else {
            if (Math.abs(l) < n) {
                System.out.println(total);
            } else {
                System.out.println(total - (l + n - 1));
            }
        }
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();

        int total = l * n + n * (n - 1) / 2;
        if (l >= 0) {
            System.out.println(total - l);
        } else {
            if (Math.abs(l) < n) {
                System.out.println(total);
            } else {
                System.out.println(total - (l + n - 1));
            }
        }
    }
}
