import java.util.*;
import java.util.ArrayList;
import java.util.Collections;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        int[] apple = new int[n];
        for(int i = 0; i < n; i++){
            apple[i] = l + i;
        }
        int taste = 0;
        for(int i = 0; i < n; i++){
            taste = taste + apple[i];
        }
        int taste2 = 0;
        int sub = 100000;
        int eaten = 0;
        for(int i = 0; i < n; i++){
            taste2 = taste - apple[i];
            if(sub > Math.abs(taste-taste2)){
                sub = Math.abs(taste - taste2);
                eaten = i;
            }
        }
        System.out.print(taste - apple[eaten]);
    }
} import java.util.*; util.* java import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections 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[] apple = new int[n];
        for(int i = 0; i < n; i++){
            apple[i] = l + i;
        }
        int taste = 0;
        for(int i = 0; i < n; i++){
            taste = taste + apple[i];
        }
        int taste2 = 0;
        int sub = 100000;
        int eaten = 0;
        for(int i = 0; i < n; i++){
            taste2 = taste - apple[i];
            if(sub > Math.abs(taste-taste2)){
                sub = Math.abs(taste - taste2);
                eaten = i;
            }
        }
        System.out.print(taste - apple[eaten]);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        int[] apple = new int[n];
        for(int i = 0; i < n; i++){
            apple[i] = l + i;
        }
        int taste = 0;
        for(int i = 0; i < n; i++){
            taste = taste + apple[i];
        }
        int taste2 = 0;
        int sub = 100000;
        int eaten = 0;
        for(int i = 0; i < n; i++){
            taste2 = taste - apple[i];
            if(sub > Math.abs(taste-taste2)){
                sub = Math.abs(taste - taste2);
                eaten = i;
            }
        }
        System.out.print(taste - apple[eaten]);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        int[] apple = new int[n];
        for(int i = 0; i < n; i++){
            apple[i] = l + i;
        }
        int taste = 0;
        for(int i = 0; i < n; i++){
            taste = taste + apple[i];
        }
        int taste2 = 0;
        int sub = 100000;
        int eaten = 0;
        for(int i = 0; i < n; i++){
            taste2 = taste - apple[i];
            if(sub > Math.abs(taste-taste2)){
                sub = Math.abs(taste - taste2);
                eaten = i;
            }
        }
        System.out.print(taste - apple[eaten]);
    } 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[] apple = new int[n]; apple new int[n] n for(int i = 0; i < n; i++){
            apple[i] = l + i;
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            apple[i] = l + i;
        } {
            apple[i] = l + i;
        } apple[i] = l + i apple[i] apple i l + i l i int taste = 0; taste 0 for(int i = 0; i < n; i++){
            taste = taste + apple[i];
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            taste = taste + apple[i];
        } {
            taste = taste + apple[i];
        } taste = taste + apple[i] taste taste + apple[i] taste apple[i] apple i int taste2 = 0; taste2 0 int sub = 100000; sub 100000 int eaten = 0; eaten 0 for(int i = 0; i < n; i++){
            taste2 = taste - apple[i];
            if(sub > Math.abs(taste-taste2)){
                sub = Math.abs(taste - taste2);
                eaten = i;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            taste2 = taste - apple[i];
            if(sub > Math.abs(taste-taste2)){
                sub = Math.abs(taste - taste2);
                eaten = i;
            }
        } {
            taste2 = taste - apple[i];
            if(sub > Math.abs(taste-taste2)){
                sub = Math.abs(taste - taste2);
                eaten = i;
            }
        } taste2 = taste - apple[i] taste2 taste - apple[i] taste apple[i] apple i if(sub > Math.abs(taste-taste2)){
                sub = Math.abs(taste - taste2);
                eaten = i;
            } sub > Math.abs(taste-taste2) sub Math.abs(taste-taste2) Math.abs Math taste-taste2 taste taste2 {
                sub = Math.abs(taste - taste2);
                eaten = i;
            } sub = Math.abs(taste - taste2) sub Math.abs(taste - taste2) Math.abs Math taste - taste2 taste taste2 eaten = i eaten i System.out.print(taste - apple[eaten]) System.out.print System.out System System.out taste - apple[eaten] taste apple[eaten] apple eaten 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[] apple = new int[n];
        for(int i = 0; i < n; i++){
            apple[i] = l + i;
        }
        int taste = 0;
        for(int i = 0; i < n; i++){
            taste = taste + apple[i];
        }
        int taste2 = 0;
        int sub = 100000;
        int eaten = 0;
        for(int i = 0; i < n; i++){
            taste2 = taste - apple[i];
            if(sub > Math.abs(taste-taste2)){
                sub = Math.abs(taste - taste2);
                eaten = i;
            }
        }
        System.out.print(taste - apple[eaten]);
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        int[] apple = new int[n];
        for(int i = 0; i < n; i++){
            apple[i] = l + i;
        }
        int taste = 0;
        for(int i = 0; i < n; i++){
            taste = taste + apple[i];
        }
        int taste2 = 0;
        int sub = 100000;
        int eaten = 0;
        for(int i = 0; i < n; i++){
            taste2 = taste - apple[i];
            if(sub > Math.abs(taste-taste2)){
                sub = Math.abs(taste - taste2);
                eaten = i;
            }
        }
        System.out.print(taste - apple[eaten]);
    }
} Main
import java.util.*;
import java.util.ArrayList;
import java.util.Collections;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        int[] apple = new int[n];
        for(int i = 0; i < n; i++){
            apple[i] = l + i;
        }
        int taste = 0;
        for(int i = 0; i < n; i++){
            taste = taste + apple[i];
        }
        int taste2 = 0;
        int sub = 100000;
        int eaten = 0;
        for(int i = 0; i < n; i++){
            taste2 = taste - apple[i];
            if(sub > Math.abs(taste-taste2)){
                sub = Math.abs(taste - taste2);
                eaten = i;
            }
        }
        System.out.print(taste - apple[eaten]);
    }
}