import java.util.Scanner;

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

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