import java.util.*;
/**
 * Main
 */
public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int L = sc.nextInt();
        int val = (L-1)*N + (N*(N+1))/2 - eatval(N, L);
        System.out.println(val);
        sc.close();
    }

    static int eatval(int N, int L) {
        if(N < -L+1) 
            return L+N-1;
        else if(1 <= -L+1 && -L+1 <= N)
            return 0;
        else
            return L;
    }
} 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 val = (L-1)*N + (N*(N+1))/2 - eatval(N, L);
        System.out.println(val);
        sc.close();
    }

    static int eatval(int N, int L) {
        if(N < -L+1) 
            return L+N-1;
        else if(1 <= -L+1 && -L+1 <= N)
            return 0;
        else
            return L;
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int L = sc.nextInt();
        int val = (L-1)*N + (N*(N+1))/2 - eatval(N, L);
        System.out.println(val);
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int L = sc.nextInt();
        int val = (L-1)*N + (N*(N+1))/2 - eatval(N, L);
        System.out.println(val);
        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 val = (L-1)*N + (N*(N+1))/2 - eatval(N, L); val (L-1)*N + (N*(N+1))/2 - eatval(N, L) (L-1)*N + (N*(N+1))/2 (L-1)*N (L-1) L 1 N (N*(N+1))/2 (N*(N+1)) N (N+1) N 1 2 eatval(N, L) eatval N L System.out.println(val) System.out.println System.out System System.out val sc.close() sc.close sc String[] args args static int eatval(int N, int L) {
        if(N < -L+1) 
            return L+N-1;
        else if(1 <= -L+1 && -L+1 <= N)
            return 0;
        else
            return L;
    } eatval {
        if(N < -L+1) 
            return L+N-1;
        else if(1 <= -L+1 && -L+1 <= N)
            return 0;
        else
            return L;
    } if(N < -L+1) 
            return L+N-1;
        else if(1 <= -L+1 && -L+1 <= N)
            return 0;
        else
            return L; N < -L+1 N -L+1 -L L 1 return L+N-1; L+N-1 L+N L N 1 if(1 <= -L+1 && -L+1 <= N)
            return 0;
        else
            return L; 1 <= -L+1 && -L+1 <= N 1 <= -L+1 1 -L+1 -L L 1 -L+1 <= N -L+1 -L L 1 N return 0; 0 return L; L int N N int L L public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int L = sc.nextInt();
        int val = (L-1)*N + (N*(N+1))/2 - eatval(N, L);
        System.out.println(val);
        sc.close();
    }

    static int eatval(int N, int L) {
        if(N < -L+1) 
            return L+N-1;
        else if(1 <= -L+1 && -L+1 <= N)
            return 0;
        else
            return L;
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int L = sc.nextInt();
        int val = (L-1)*N + (N*(N+1))/2 - eatval(N, L);
        System.out.println(val);
        sc.close();
    }

    static int eatval(int N, int L) {
        if(N < -L+1) 
            return L+N-1;
        else if(1 <= -L+1 && -L+1 <= N)
            return 0;
        else
            return L;
    }
} Main
import java.util.*;
/**
 * Main
 */
public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int L = sc.nextInt();
        int val = (L-1)*N + (N*(N+1))/2 - eatval(N, L);
        System.out.println(val);
        sc.close();
    }

    static int eatval(int N, int L) {
        if(N < -L+1) 
            return L+N-1;
        else if(1 <= -L+1 && -L+1 <= N)
            return 0;
        else
            return L;
    }
}