import java.util.*;

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

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int l = scan.nextInt();
        int min = Math.abs(l);
        int sub = l;
        for(int i = 2; i <= n; i++){
            if(Math.abs(l + i - 1) < min){
                min = Math.abs(l + i - 1);
                sub = l + i - 1;
            }
        }
        int sum = 0;
        for(int i = 1; i <= n; i++){
            sum += l + i - 1;
        }
        System.out.println(sum - sub);
    }
}