import java.util.*;
import java.math.*;

public class Main {

    static long MOD = 1000000007;



    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        int[] a = new int[n];
        for(int i = 0; i < n; i++) {
            a[i] = i + l;
        }
        int sum = 0;
        for(int i = 0; i < n; i++) {
            sum += a[i];
        }
        int dif = 324092384;
        int ans = sum * 2;
        for(int i = 0; i < n; i++) {
            if(Math.abs(a[i]) < dif) {
                dif = Math.abs(a[i]);
                ans = sum - a[i];
            }
        }
        System.out.println(ans);
    }
} import java.util.*; util.* java import java.math.*; math.* java public class Main {

    static long MOD = 1000000007;



    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        int[] a = new int[n];
        for(int i = 0; i < n; i++) {
            a[i] = i + l;
        }
        int sum = 0;
        for(int i = 0; i < n; i++) {
            sum += a[i];
        }
        int dif = 324092384;
        int ans = sum * 2;
        for(int i = 0; i < n; i++) {
            if(Math.abs(a[i]) < dif) {
                dif = Math.abs(a[i]);
                ans = sum - a[i];
            }
        }
        System.out.println(ans);
    }
} Main static long MOD = 1000000007; MOD 1000000007 public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        int[] a = new int[n];
        for(int i = 0; i < n; i++) {
            a[i] = i + l;
        }
        int sum = 0;
        for(int i = 0; i < n; i++) {
            sum += a[i];
        }
        int dif = 324092384;
        int ans = sum * 2;
        for(int i = 0; i < n; i++) {
            if(Math.abs(a[i]) < dif) {
                dif = Math.abs(a[i]);
                ans = sum - a[i];
            }
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        int[] a = new int[n];
        for(int i = 0; i < n; i++) {
            a[i] = i + l;
        }
        int sum = 0;
        for(int i = 0; i < n; i++) {
            sum += a[i];
        }
        int dif = 324092384;
        int ans = sum * 2;
        for(int i = 0; i < n; i++) {
            if(Math.abs(a[i]) < dif) {
                dif = Math.abs(a[i]);
                ans = sum - a[i];
            }
        }
        System.out.println(ans);
    } 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[] a = new int[n]; a new int[n] n for(int i = 0; i < n; i++) {
            a[i] = i + l;
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            a[i] = i + l;
        } {
            a[i] = i + l;
        } a[i] = i + l a[i] a i i + l i l int sum = 0; sum 0 for(int i = 0; i < n; i++) {
            sum += a[i];
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            sum += a[i];
        } {
            sum += a[i];
        } sum += a[i] sum a[i] a i int dif = 324092384; dif 324092384 int ans = sum * 2; ans sum * 2 sum 2 for(int i = 0; i < n; i++) {
            if(Math.abs(a[i]) < dif) {
                dif = Math.abs(a[i]);
                ans = sum - a[i];
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            if(Math.abs(a[i]) < dif) {
                dif = Math.abs(a[i]);
                ans = sum - a[i];
            }
        } {
            if(Math.abs(a[i]) < dif) {
                dif = Math.abs(a[i]);
                ans = sum - a[i];
            }
        } if(Math.abs(a[i]) < dif) {
                dif = Math.abs(a[i]);
                ans = sum - a[i];
            } Math.abs(a[i]) < dif Math.abs(a[i]) Math.abs Math a[i] a i dif {
                dif = Math.abs(a[i]);
                ans = sum - a[i];
            } dif = Math.abs(a[i]) dif Math.abs(a[i]) Math.abs Math a[i] a i ans = sum - a[i] ans sum - a[i] sum a[i] a i System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

    static long MOD = 1000000007;



    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        int[] a = new int[n];
        for(int i = 0; i < n; i++) {
            a[i] = i + l;
        }
        int sum = 0;
        for(int i = 0; i < n; i++) {
            sum += a[i];
        }
        int dif = 324092384;
        int ans = sum * 2;
        for(int i = 0; i < n; i++) {
            if(Math.abs(a[i]) < dif) {
                dif = Math.abs(a[i]);
                ans = sum - a[i];
            }
        }
        System.out.println(ans);
    }
} public class Main {

    static long MOD = 1000000007;



    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        int[] a = new int[n];
        for(int i = 0; i < n; i++) {
            a[i] = i + l;
        }
        int sum = 0;
        for(int i = 0; i < n; i++) {
            sum += a[i];
        }
        int dif = 324092384;
        int ans = sum * 2;
        for(int i = 0; i < n; i++) {
            if(Math.abs(a[i]) < dif) {
                dif = Math.abs(a[i]);
                ans = sum - a[i];
            }
        }
        System.out.println(ans);
    }
} Main
import java.util.*;
import java.math.*;

public class Main {

    static long MOD = 1000000007;



    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        int[] a = new int[n];
        for(int i = 0; i < n; i++) {
            a[i] = i + l;
        }
        int sum = 0;
        for(int i = 0; i < n; i++) {
            sum += a[i];
        }
        int dif = 324092384;
        int ans = sum * 2;
        for(int i = 0; i < n; i++) {
            if(Math.abs(a[i]) < dif) {
                dif = Math.abs(a[i]);
                ans = sum - a[i];
            }
        }
        System.out.println(ans);
    }
}