import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        int min = Math.abs(l);
        int k = 1;
        int sum = l;
        for (int i = 2; i <= n; i++) {
            if (min > Math.abs(l - 1 + i)) {
                min = Math.abs(l - 1 + i);
                k = i;
            }
            sum += l + i - 1;
        }
        System.out.println(sum - (l + k - 1));
        sc.close();
    }
} import java.util.Scanner; Scanner 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 min = Math.abs(l);
        int k = 1;
        int sum = l;
        for (int i = 2; i <= n; i++) {
            if (min > Math.abs(l - 1 + i)) {
                min = Math.abs(l - 1 + i);
                k = i;
            }
            sum += l + i - 1;
        }
        System.out.println(sum - (l + k - 1));
        sc.close();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        int min = Math.abs(l);
        int k = 1;
        int sum = l;
        for (int i = 2; i <= n; i++) {
            if (min > Math.abs(l - 1 + i)) {
                min = Math.abs(l - 1 + i);
                k = i;
            }
            sum += l + i - 1;
        }
        System.out.println(sum - (l + k - 1));
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        int min = Math.abs(l);
        int k = 1;
        int sum = l;
        for (int i = 2; i <= n; i++) {
            if (min > Math.abs(l - 1 + i)) {
                min = Math.abs(l - 1 + i);
                k = i;
            }
            sum += l + i - 1;
        }
        System.out.println(sum - (l + k - 1));
        sc.close();
    } 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 min = Math.abs(l); min Math.abs(l) Math.abs Math l int k = 1; k 1 int sum = l; sum l for (int i = 2; i <= n; i++) {
            if (min > Math.abs(l - 1 + i)) {
                min = Math.abs(l - 1 + i);
                k = i;
            }
            sum += l + i - 1;
        } int i = 2; int i = 2; i 2 i <= n i n i++ i++ i {
            if (min > Math.abs(l - 1 + i)) {
                min = Math.abs(l - 1 + i);
                k = i;
            }
            sum += l + i - 1;
        } {
            if (min > Math.abs(l - 1 + i)) {
                min = Math.abs(l - 1 + i);
                k = i;
            }
            sum += l + i - 1;
        } if (min > Math.abs(l - 1 + i)) {
                min = Math.abs(l - 1 + i);
                k = i;
            } min > Math.abs(l - 1 + i) min Math.abs(l - 1 + i) Math.abs Math l - 1 + i l - 1 l 1 i {
                min = Math.abs(l - 1 + i);
                k = i;
            } min = Math.abs(l - 1 + i) min Math.abs(l - 1 + i) Math.abs Math l - 1 + i l - 1 l 1 i k = i k i sum += l + i - 1 sum l + i - 1 l + i l i 1 System.out.println(sum - (l + k - 1)) System.out.println System.out System System.out sum - (l + k - 1) sum (l + k - 1) l + k l k 1 sc.close() sc.close sc 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 min = Math.abs(l);
        int k = 1;
        int sum = l;
        for (int i = 2; i <= n; i++) {
            if (min > Math.abs(l - 1 + i)) {
                min = Math.abs(l - 1 + i);
                k = i;
            }
            sum += l + i - 1;
        }
        System.out.println(sum - (l + k - 1));
        sc.close();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        int min = Math.abs(l);
        int k = 1;
        int sum = l;
        for (int i = 2; i <= n; i++) {
            if (min > Math.abs(l - 1 + i)) {
                min = Math.abs(l - 1 + i);
                k = i;
            }
            sum += l + i - 1;
        }
        System.out.println(sum - (l + k - 1));
        sc.close();
    }
} Main
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        int min = Math.abs(l);
        int k = 1;
        int sum = l;
        for (int i = 2; i <= n; i++) {
            if (min > Math.abs(l - 1 + i)) {
                min = Math.abs(l - 1 + i);
                k = i;
            }
            sum += l + i - 1;
        }
        System.out.println(sum - (l + k - 1));
        sc.close();
    }
}