import java.util.*;
import java.io.*;

public class Main
{
	public static void main(String [] Args)
	{
		Scanner in=new Scanner(System.in);		
		int n=in.nextInt();
		int l=in.nextInt();
		int ans=(l-1)*n+n*(n+1)/2;
		int q=Math.min(Math.abs(l),Math.abs(l+n-1));
		if(l<0&&l+n-1>0)
		{
			ans=ans;
		}
		else if(Math.abs(l)<Math.abs(l+n-1))
		{
			ans=ans-l;
		}
		else
		{
			ans=ans-l-n+1;
		}
		System.out.println(ans);
	}
}
	 import java.util.*; util.* java import java.io.*; io.* java public class Main
{
	public static void main(String [] Args)
	{
		Scanner in=new Scanner(System.in);		
		int n=in.nextInt();
		int l=in.nextInt();
		int ans=(l-1)*n+n*(n+1)/2;
		int q=Math.min(Math.abs(l),Math.abs(l+n-1));
		if(l<0&&l+n-1>0)
		{
			ans=ans;
		}
		else if(Math.abs(l)<Math.abs(l+n-1))
		{
			ans=ans-l;
		}
		else
		{
			ans=ans-l-n+1;
		}
		System.out.println(ans);
	}
} Main public static void main(String [] Args)
	{
		Scanner in=new Scanner(System.in);		
		int n=in.nextInt();
		int l=in.nextInt();
		int ans=(l-1)*n+n*(n+1)/2;
		int q=Math.min(Math.abs(l),Math.abs(l+n-1));
		if(l<0&&l+n-1>0)
		{
			ans=ans;
		}
		else if(Math.abs(l)<Math.abs(l+n-1))
		{
			ans=ans-l;
		}
		else
		{
			ans=ans-l-n+1;
		}
		System.out.println(ans);
	} main {
		Scanner in=new Scanner(System.in);		
		int n=in.nextInt();
		int l=in.nextInt();
		int ans=(l-1)*n+n*(n+1)/2;
		int q=Math.min(Math.abs(l),Math.abs(l+n-1));
		if(l<0&&l+n-1>0)
		{
			ans=ans;
		}
		else if(Math.abs(l)<Math.abs(l+n-1))
		{
			ans=ans-l;
		}
		else
		{
			ans=ans-l-n+1;
		}
		System.out.println(ans);
	} 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 int ans=(l-1)*n+n*(n+1)/2; ans (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 int q=Math.min(Math.abs(l),Math.abs(l+n-1)); q Math.min(Math.abs(l),Math.abs(l+n-1)) Math.min Math Math.abs(l) Math.abs Math l Math.abs(l+n-1) Math.abs Math l+n-1 l+n l n 1 if(l<0&&l+n-1>0)
		{
			ans=ans;
		}
		else if(Math.abs(l)<Math.abs(l+n-1))
		{
			ans=ans-l;
		}
		else
		{
			ans=ans-l-n+1;
		} l<0&&l+n-1>0 l<0 l 0 l+n-1>0 l+n-1 l+n l n 1 0 {
			ans=ans;
		} ans=ans ans ans if(Math.abs(l)<Math.abs(l+n-1))
		{
			ans=ans-l;
		}
		else
		{
			ans=ans-l-n+1;
		} Math.abs(l)<Math.abs(l+n-1) Math.abs(l) Math.abs Math l Math.abs(l+n-1) Math.abs Math l+n-1 l+n l n 1 {
			ans=ans-l;
		} ans=ans-l ans ans-l ans l {
			ans=ans-l-n+1;
		} ans=ans-l-n+1 ans ans-l-n+1 ans-l-n ans-l-n ans l n 1 System.out.println(ans) System.out.println System.out System System.out ans 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();
		int ans=(l-1)*n+n*(n+1)/2;
		int q=Math.min(Math.abs(l),Math.abs(l+n-1));
		if(l<0&&l+n-1>0)
		{
			ans=ans;
		}
		else if(Math.abs(l)<Math.abs(l+n-1))
		{
			ans=ans-l;
		}
		else
		{
			ans=ans-l-n+1;
		}
		System.out.println(ans);
	}
} public class Main
{
	public static void main(String [] Args)
	{
		Scanner in=new Scanner(System.in);		
		int n=in.nextInt();
		int l=in.nextInt();
		int ans=(l-1)*n+n*(n+1)/2;
		int q=Math.min(Math.abs(l),Math.abs(l+n-1));
		if(l<0&&l+n-1>0)
		{
			ans=ans;
		}
		else if(Math.abs(l)<Math.abs(l+n-1))
		{
			ans=ans-l;
		}
		else
		{
			ans=ans-l-n+1;
		}
		System.out.println(ans);
	}
} Main
import java.util.*;
import java.io.*;

public class Main
{
	public static void main(String [] Args)
	{
		Scanner in=new Scanner(System.in);		
		int n=in.nextInt();
		int l=in.nextInt();
		int ans=(l-1)*n+n*(n+1)/2;
		int q=Math.min(Math.abs(l),Math.abs(l+n-1));
		if(l<0&&l+n-1>0)
		{
			ans=ans;
		}
		else if(Math.abs(l)<Math.abs(l+n-1))
		{
			ans=ans-l;
		}
		else
		{
			ans=ans-l-n+1;
		}
		System.out.println(ans);
	}
}
	