import java.util.*;
import java.lang.*;
import java.io.*;
class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int L = sc.nextInt();
		int[] flavour = new int[N];
		int count = 0;
		int zero = 0;
		int flagZero = 0;
		int negative = 0;
		int flagnegative = 0;
		int firstPositiveIndex = 0;
		int flagfirstPositiveIndex = 0;
		int allNegative = 0;
		for(int i = 0; i <N; i++)
		{
		    flavour[i] = L + i;
		    if(flavour[i] > 0 && flagfirstPositiveIndex == 0)
		    {
		        firstPositiveIndex = i;
		        flagfirstPositiveIndex = 1;
		    }
		    if(flavour[i] == 0 && flagZero == 0)
		    {
		        zero = 1;
		        flagZero = 1;
		    }
		    if(flavour[i] < 0)
		    {
		        allNegative = 1; 
		    }
		    if(flavour[i] < 0 && flagnegative == 0)
		    {
		        negative = 1;
		        flagnegative = 1;
		    }
		    
		}
		int sum = 0;
		if(zero == 1)
		{
		    for(int i = 0; i <N; i++)
	    	{
		        sum = sum + flavour[i];
		    }
		    System.out.println(sum);
		}
		else if(negative == 0)
		{
		    for(int i = 1; i <N; i++)
	    	{
		        sum = sum + flavour[i];
		    }
		    System.out.println(sum);
		}
		else if(allNegative == 1)
		{
		    for(int i = 0; i <N-1; i++)
	    	{
		        sum = sum + flavour[i];
		    }
		    System.out.println(sum);
		}
		else
		{
		    for(int i = 0; i <N; i++)
	    	{
	    	    if(i != firstPositiveIndex - 1)
	    	    {
		            sum = sum + flavour[i];
	    	    }
		    }
		    System.out.println(sum);
		}
	}
} import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int L = sc.nextInt();
		int[] flavour = new int[N];
		int count = 0;
		int zero = 0;
		int flagZero = 0;
		int negative = 0;
		int flagnegative = 0;
		int firstPositiveIndex = 0;
		int flagfirstPositiveIndex = 0;
		int allNegative = 0;
		for(int i = 0; i <N; i++)
		{
		    flavour[i] = L + i;
		    if(flavour[i] > 0 && flagfirstPositiveIndex == 0)
		    {
		        firstPositiveIndex = i;
		        flagfirstPositiveIndex = 1;
		    }
		    if(flavour[i] == 0 && flagZero == 0)
		    {
		        zero = 1;
		        flagZero = 1;
		    }
		    if(flavour[i] < 0)
		    {
		        allNegative = 1; 
		    }
		    if(flavour[i] < 0 && flagnegative == 0)
		    {
		        negative = 1;
		        flagnegative = 1;
		    }
		    
		}
		int sum = 0;
		if(zero == 1)
		{
		    for(int i = 0; i <N; i++)
	    	{
		        sum = sum + flavour[i];
		    }
		    System.out.println(sum);
		}
		else if(negative == 0)
		{
		    for(int i = 1; i <N; i++)
	    	{
		        sum = sum + flavour[i];
		    }
		    System.out.println(sum);
		}
		else if(allNegative == 1)
		{
		    for(int i = 0; i <N-1; i++)
	    	{
		        sum = sum + flavour[i];
		    }
		    System.out.println(sum);
		}
		else
		{
		    for(int i = 0; i <N; i++)
	    	{
	    	    if(i != firstPositiveIndex - 1)
	    	    {
		            sum = sum + flavour[i];
	    	    }
		    }
		    System.out.println(sum);
		}
	}
} Main public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int L = sc.nextInt();
		int[] flavour = new int[N];
		int count = 0;
		int zero = 0;
		int flagZero = 0;
		int negative = 0;
		int flagnegative = 0;
		int firstPositiveIndex = 0;
		int flagfirstPositiveIndex = 0;
		int allNegative = 0;
		for(int i = 0; i <N; i++)
		{
		    flavour[i] = L + i;
		    if(flavour[i] > 0 && flagfirstPositiveIndex == 0)
		    {
		        firstPositiveIndex = i;
		        flagfirstPositiveIndex = 1;
		    }
		    if(flavour[i] == 0 && flagZero == 0)
		    {
		        zero = 1;
		        flagZero = 1;
		    }
		    if(flavour[i] < 0)
		    {
		        allNegative = 1; 
		    }
		    if(flavour[i] < 0 && flagnegative == 0)
		    {
		        negative = 1;
		        flagnegative = 1;
		    }
		    
		}
		int sum = 0;
		if(zero == 1)
		{
		    for(int i = 0; i <N; i++)
	    	{
		        sum = sum + flavour[i];
		    }
		    System.out.println(sum);
		}
		else if(negative == 0)
		{
		    for(int i = 1; i <N; i++)
	    	{
		        sum = sum + flavour[i];
		    }
		    System.out.println(sum);
		}
		else if(allNegative == 1)
		{
		    for(int i = 0; i <N-1; i++)
	    	{
		        sum = sum + flavour[i];
		    }
		    System.out.println(sum);
		}
		else
		{
		    for(int i = 0; i <N; i++)
	    	{
	    	    if(i != firstPositiveIndex - 1)
	    	    {
		            sum = sum + flavour[i];
	    	    }
		    }
		    System.out.println(sum);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int L = sc.nextInt();
		int[] flavour = new int[N];
		int count = 0;
		int zero = 0;
		int flagZero = 0;
		int negative = 0;
		int flagnegative = 0;
		int firstPositiveIndex = 0;
		int flagfirstPositiveIndex = 0;
		int allNegative = 0;
		for(int i = 0; i <N; i++)
		{
		    flavour[i] = L + i;
		    if(flavour[i] > 0 && flagfirstPositiveIndex == 0)
		    {
		        firstPositiveIndex = i;
		        flagfirstPositiveIndex = 1;
		    }
		    if(flavour[i] == 0 && flagZero == 0)
		    {
		        zero = 1;
		        flagZero = 1;
		    }
		    if(flavour[i] < 0)
		    {
		        allNegative = 1; 
		    }
		    if(flavour[i] < 0 && flagnegative == 0)
		    {
		        negative = 1;
		        flagnegative = 1;
		    }
		    
		}
		int sum = 0;
		if(zero == 1)
		{
		    for(int i = 0; i <N; i++)
	    	{
		        sum = sum + flavour[i];
		    }
		    System.out.println(sum);
		}
		else if(negative == 0)
		{
		    for(int i = 1; i <N; i++)
	    	{
		        sum = sum + flavour[i];
		    }
		    System.out.println(sum);
		}
		else if(allNegative == 1)
		{
		    for(int i = 0; i <N-1; i++)
	    	{
		        sum = sum + flavour[i];
		    }
		    System.out.println(sum);
		}
		else
		{
		    for(int i = 0; i <N; i++)
	    	{
	    	    if(i != firstPositiveIndex - 1)
	    	    {
		            sum = sum + flavour[i];
	    	    }
		    }
		    System.out.println(sum);
		}
	} 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[] flavour = new int[N]; flavour new int[N] N int count = 0; count 0 int zero = 0; zero 0 int flagZero = 0; flagZero 0 int negative = 0; negative 0 int flagnegative = 0; flagnegative 0 int firstPositiveIndex = 0; firstPositiveIndex 0 int flagfirstPositiveIndex = 0; flagfirstPositiveIndex 0 int allNegative = 0; allNegative 0 for(int i = 0; i <N; i++)
		{
		    flavour[i] = L + i;
		    if(flavour[i] > 0 && flagfirstPositiveIndex == 0)
		    {
		        firstPositiveIndex = i;
		        flagfirstPositiveIndex = 1;
		    }
		    if(flavour[i] == 0 && flagZero == 0)
		    {
		        zero = 1;
		        flagZero = 1;
		    }
		    if(flavour[i] < 0)
		    {
		        allNegative = 1; 
		    }
		    if(flavour[i] < 0 && flagnegative == 0)
		    {
		        negative = 1;
		        flagnegative = 1;
		    }
		    
		} int i = 0; int i = 0; i 0 i <N i N i++ i++ i {
		    flavour[i] = L + i;
		    if(flavour[i] > 0 && flagfirstPositiveIndex == 0)
		    {
		        firstPositiveIndex = i;
		        flagfirstPositiveIndex = 1;
		    }
		    if(flavour[i] == 0 && flagZero == 0)
		    {
		        zero = 1;
		        flagZero = 1;
		    }
		    if(flavour[i] < 0)
		    {
		        allNegative = 1; 
		    }
		    if(flavour[i] < 0 && flagnegative == 0)
		    {
		        negative = 1;
		        flagnegative = 1;
		    }
		    
		} {
		    flavour[i] = L + i;
		    if(flavour[i] > 0 && flagfirstPositiveIndex == 0)
		    {
		        firstPositiveIndex = i;
		        flagfirstPositiveIndex = 1;
		    }
		    if(flavour[i] == 0 && flagZero == 0)
		    {
		        zero = 1;
		        flagZero = 1;
		    }
		    if(flavour[i] < 0)
		    {
		        allNegative = 1; 
		    }
		    if(flavour[i] < 0 && flagnegative == 0)
		    {
		        negative = 1;
		        flagnegative = 1;
		    }
		    
		} flavour[i] = L + i flavour[i] flavour i L + i L i if(flavour[i] > 0 && flagfirstPositiveIndex == 0)
		    {
		        firstPositiveIndex = i;
		        flagfirstPositiveIndex = 1;
		    } flavour[i] > 0 && flagfirstPositiveIndex == 0 flavour[i] > 0 flavour[i] flavour i 0 flagfirstPositiveIndex == 0 flagfirstPositiveIndex 0 {
		        firstPositiveIndex = i;
		        flagfirstPositiveIndex = 1;
		    } firstPositiveIndex = i firstPositiveIndex i flagfirstPositiveIndex = 1 flagfirstPositiveIndex 1 if(flavour[i] == 0 && flagZero == 0)
		    {
		        zero = 1;
		        flagZero = 1;
		    } flavour[i] == 0 && flagZero == 0 flavour[i] == 0 flavour[i] flavour i 0 flagZero == 0 flagZero 0 {
		        zero = 1;
		        flagZero = 1;
		    } zero = 1 zero 1 flagZero = 1 flagZero 1 if(flavour[i] < 0)
		    {
		        allNegative = 1; 
		    } flavour[i] < 0 flavour[i] flavour i 0 {
		        allNegative = 1; 
		    } allNegative = 1 allNegative 1 if(flavour[i] < 0 && flagnegative == 0)
		    {
		        negative = 1;
		        flagnegative = 1;
		    } flavour[i] < 0 && flagnegative == 0 flavour[i] < 0 flavour[i] flavour i 0 flagnegative == 0 flagnegative 0 {
		        negative = 1;
		        flagnegative = 1;
		    } negative = 1 negative 1 flagnegative = 1 flagnegative 1 int sum = 0; sum 0 if(zero == 1)
		{
		    for(int i = 0; i <N; i++)
	    	{
		        sum = sum + flavour[i];
		    }
		    System.out.println(sum);
		}
		else if(negative == 0)
		{
		    for(int i = 1; i <N; i++)
	    	{
		        sum = sum + flavour[i];
		    }
		    System.out.println(sum);
		}
		else if(allNegative == 1)
		{
		    for(int i = 0; i <N-1; i++)
	    	{
		        sum = sum + flavour[i];
		    }
		    System.out.println(sum);
		}
		else
		{
		    for(int i = 0; i <N; i++)
	    	{
	    	    if(i != firstPositiveIndex - 1)
	    	    {
		            sum = sum + flavour[i];
	    	    }
		    }
		    System.out.println(sum);
		} zero == 1 zero 1 {
		    for(int i = 0; i <N; i++)
	    	{
		        sum = sum + flavour[i];
		    }
		    System.out.println(sum);
		} for(int i = 0; i <N; i++)
	    	{
		        sum = sum + flavour[i];
		    } int i = 0; int i = 0; i 0 i <N i N i++ i++ i {
		        sum = sum + flavour[i];
		    } {
		        sum = sum + flavour[i];
		    } sum = sum + flavour[i] sum sum + flavour[i] sum flavour[i] flavour i System.out.println(sum) System.out.println System.out System System.out sum if(negative == 0)
		{
		    for(int i = 1; i <N; i++)
	    	{
		        sum = sum + flavour[i];
		    }
		    System.out.println(sum);
		}
		else if(allNegative == 1)
		{
		    for(int i = 0; i <N-1; i++)
	    	{
		        sum = sum + flavour[i];
		    }
		    System.out.println(sum);
		}
		else
		{
		    for(int i = 0; i <N; i++)
	    	{
	    	    if(i != firstPositiveIndex - 1)
	    	    {
		            sum = sum + flavour[i];
	    	    }
		    }
		    System.out.println(sum);
		} negative == 0 negative 0 {
		    for(int i = 1; i <N; i++)
	    	{
		        sum = sum + flavour[i];
		    }
		    System.out.println(sum);
		} for(int i = 1; i <N; i++)
	    	{
		        sum = sum + flavour[i];
		    } int i = 1; int i = 1; i 1 i <N i N i++ i++ i {
		        sum = sum + flavour[i];
		    } {
		        sum = sum + flavour[i];
		    } sum = sum + flavour[i] sum sum + flavour[i] sum flavour[i] flavour i System.out.println(sum) System.out.println System.out System System.out sum if(allNegative == 1)
		{
		    for(int i = 0; i <N-1; i++)
	    	{
		        sum = sum + flavour[i];
		    }
		    System.out.println(sum);
		}
		else
		{
		    for(int i = 0; i <N; i++)
	    	{
	    	    if(i != firstPositiveIndex - 1)
	    	    {
		            sum = sum + flavour[i];
	    	    }
		    }
		    System.out.println(sum);
		} allNegative == 1 allNegative 1 {
		    for(int i = 0; i <N-1; i++)
	    	{
		        sum = sum + flavour[i];
		    }
		    System.out.println(sum);
		} for(int i = 0; i <N-1; i++)
	    	{
		        sum = sum + flavour[i];
		    } int i = 0; int i = 0; i 0 i <N-1 i N-1 N 1 i++ i++ i {
		        sum = sum + flavour[i];
		    } {
		        sum = sum + flavour[i];
		    } sum = sum + flavour[i] sum sum + flavour[i] sum flavour[i] flavour i System.out.println(sum) System.out.println System.out System System.out sum {
		    for(int i = 0; i <N; i++)
	    	{
	    	    if(i != firstPositiveIndex - 1)
	    	    {
		            sum = sum + flavour[i];
	    	    }
		    }
		    System.out.println(sum);
		} for(int i = 0; i <N; i++)
	    	{
	    	    if(i != firstPositiveIndex - 1)
	    	    {
		            sum = sum + flavour[i];
	    	    }
		    } int i = 0; int i = 0; i 0 i <N i N i++ i++ i {
	    	    if(i != firstPositiveIndex - 1)
	    	    {
		            sum = sum + flavour[i];
	    	    }
		    } {
	    	    if(i != firstPositiveIndex - 1)
	    	    {
		            sum = sum + flavour[i];
	    	    }
		    } if(i != firstPositiveIndex - 1)
	    	    {
		            sum = sum + flavour[i];
	    	    } i != firstPositiveIndex - 1 i firstPositiveIndex - 1 firstPositiveIndex 1 {
		            sum = sum + flavour[i];
	    	    } sum = sum + flavour[i] sum sum + flavour[i] sum flavour[i] flavour i System.out.println(sum) System.out.println System.out System System.out sum String[] args args
import java.util.*;
import java.lang.*;
import java.io.*;
class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int L = sc.nextInt();
		int[] flavour = new int[N];
		int count = 0;
		int zero = 0;
		int flagZero = 0;
		int negative = 0;
		int flagnegative = 0;
		int firstPositiveIndex = 0;
		int flagfirstPositiveIndex = 0;
		int allNegative = 0;
		for(int i = 0; i <N; i++)
		{
		    flavour[i] = L + i;
		    if(flavour[i] > 0 && flagfirstPositiveIndex == 0)
		    {
		        firstPositiveIndex = i;
		        flagfirstPositiveIndex = 1;
		    }
		    if(flavour[i] == 0 && flagZero == 0)
		    {
		        zero = 1;
		        flagZero = 1;
		    }
		    if(flavour[i] < 0)
		    {
		        allNegative = 1; 
		    }
		    if(flavour[i] < 0 && flagnegative == 0)
		    {
		        negative = 1;
		        flagnegative = 1;
		    }
		    
		}
		int sum = 0;
		if(zero == 1)
		{
		    for(int i = 0; i <N; i++)
	    	{
		        sum = sum + flavour[i];
		    }
		    System.out.println(sum);
		}
		else if(negative == 0)
		{
		    for(int i = 1; i <N; i++)
	    	{
		        sum = sum + flavour[i];
		    }
		    System.out.println(sum);
		}
		else if(allNegative == 1)
		{
		    for(int i = 0; i <N-1; i++)
	    	{
		        sum = sum + flavour[i];
		    }
		    System.out.println(sum);
		}
		else
		{
		    for(int i = 0; i <N; i++)
	    	{
	    	    if(i != firstPositiveIndex - 1)
	    	    {
		            sum = sum + flavour[i];
	    	    }
		    }
		    System.out.println(sum);
		}
	}
}
