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

public class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		
		int n = in.nextInt();
		int l = in.nextInt();
		int s = 0;
		int z;
		for(int i = 1; i <= n; i++)
		{
			z = l + i - 1;
			s += z;
		}
		
		
		int max = Integer.MAX_VALUE;
		int res = -1;
		for(int i = 1; i <= n; i++)
		{
			int tmp = s - (l + i - 1);
			int cur = Math.abs(s - tmp);
			
			if(cur < max)
			{
				res = i;
				max = cur;
			}
		}
		
		out.println((s - (l + res - 1)));
		out.close();
	}
	
	static class InputReader
	{
		BufferedReader reader;
		StringTokenizer tokenizer;
		
		public InputReader(InputStream stream)
		{
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}
		
		public String next()
		{
			while(tokenizer == null || !tokenizer.hasMoreTokens())
			{
				try
				{
					tokenizer = new StringTokenizer(reader.readLine());
				}
				catch(IOException e)
				{
					throw new RuntimeException(e);
				}
			}
			
			return tokenizer.nextToken();
		}
		
		public int nextInt()
		{
			return Integer.parseInt(next());
		}
	}
} import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java public class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		
		int n = in.nextInt();
		int l = in.nextInt();
		int s = 0;
		int z;
		for(int i = 1; i <= n; i++)
		{
			z = l + i - 1;
			s += z;
		}
		
		
		int max = Integer.MAX_VALUE;
		int res = -1;
		for(int i = 1; i <= n; i++)
		{
			int tmp = s - (l + i - 1);
			int cur = Math.abs(s - tmp);
			
			if(cur < max)
			{
				res = i;
				max = cur;
			}
		}
		
		out.println((s - (l + res - 1)));
		out.close();
	}
	
	static class InputReader
	{
		BufferedReader reader;
		StringTokenizer tokenizer;
		
		public InputReader(InputStream stream)
		{
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}
		
		public String next()
		{
			while(tokenizer == null || !tokenizer.hasMoreTokens())
			{
				try
				{
					tokenizer = new StringTokenizer(reader.readLine());
				}
				catch(IOException e)
				{
					throw new RuntimeException(e);
				}
			}
			
			return tokenizer.nextToken();
		}
		
		public int nextInt()
		{
			return Integer.parseInt(next());
		}
	}
} Main public static void main (String[] args) throws java.lang.Exception
	{
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		
		int n = in.nextInt();
		int l = in.nextInt();
		int s = 0;
		int z;
		for(int i = 1; i <= n; i++)
		{
			z = l + i - 1;
			s += z;
		}
		
		
		int max = Integer.MAX_VALUE;
		int res = -1;
		for(int i = 1; i <= n; i++)
		{
			int tmp = s - (l + i - 1);
			int cur = Math.abs(s - tmp);
			
			if(cur < max)
			{
				res = i;
				max = cur;
			}
		}
		
		out.println((s - (l + res - 1)));
		out.close();
	} main {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		
		int n = in.nextInt();
		int l = in.nextInt();
		int s = 0;
		int z;
		for(int i = 1; i <= n; i++)
		{
			z = l + i - 1;
			s += z;
		}
		
		
		int max = Integer.MAX_VALUE;
		int res = -1;
		for(int i = 1; i <= n; i++)
		{
			int tmp = s - (l + i - 1);
			int cur = Math.abs(s - tmp);
			
			if(cur < max)
			{
				res = i;
				max = cur;
			}
		}
		
		out.println((s - (l + res - 1)));
		out.close();
	} InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out InputReader in = new InputReader(inputStream); in new InputReader(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) int n = in.nextInt(); n in.nextInt() in.nextInt in int l = in.nextInt(); l in.nextInt() in.nextInt in int s = 0; s 0 int z; z for(int i = 1; i <= n; i++)
		{
			z = l + i - 1;
			s += z;
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			z = l + i - 1;
			s += z;
		} {
			z = l + i - 1;
			s += z;
		} z = l + i - 1 z l + i - 1 l + i l i 1 s += z s z int max = Integer.MAX_VALUE; max Integer.MAX_VALUE Integer Integer.MAX_VALUE int res = -1; res -1 1 for(int i = 1; i <= n; i++)
		{
			int tmp = s - (l + i - 1);
			int cur = Math.abs(s - tmp);
			
			if(cur < max)
			{
				res = i;
				max = cur;
			}
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			int tmp = s - (l + i - 1);
			int cur = Math.abs(s - tmp);
			
			if(cur < max)
			{
				res = i;
				max = cur;
			}
		} {
			int tmp = s - (l + i - 1);
			int cur = Math.abs(s - tmp);
			
			if(cur < max)
			{
				res = i;
				max = cur;
			}
		} int tmp = s - (l + i - 1); tmp s - (l + i - 1) s (l + i - 1) l + i l i 1 int cur = Math.abs(s - tmp); cur Math.abs(s - tmp) Math.abs Math s - tmp s tmp if(cur < max)
			{
				res = i;
				max = cur;
			} cur < max cur max {
				res = i;
				max = cur;
			} res = i res i max = cur max cur out.println((s - (l + res - 1))) out.println out (s - (l + res - 1)) s (l + res - 1) l + res l res 1 out.close() out.close out String[] args args static class InputReader
	{
		BufferedReader reader;
		StringTokenizer tokenizer;
		
		public InputReader(InputStream stream)
		{
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}
		
		public String next()
		{
			while(tokenizer == null || !tokenizer.hasMoreTokens())
			{
				try
				{
					tokenizer = new StringTokenizer(reader.readLine());
				}
				catch(IOException e)
				{
					throw new RuntimeException(e);
				}
			}
			
			return tokenizer.nextToken();
		}
		
		public int nextInt()
		{
			return Integer.parseInt(next());
		}
	} InputReader BufferedReader reader; reader StringTokenizer tokenizer; tokenizer public InputReader(InputStream stream)
		{
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		} InputReader {
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		} reader = new BufferedReader(new InputStreamReader(stream), 32768) reader new BufferedReader(new InputStreamReader(stream), 32768) tokenizer = null tokenizer null InputStream stream stream public String next()
		{
			while(tokenizer == null || !tokenizer.hasMoreTokens())
			{
				try
				{
					tokenizer = new StringTokenizer(reader.readLine());
				}
				catch(IOException e)
				{
					throw new RuntimeException(e);
				}
			}
			
			return tokenizer.nextToken();
		} next {
			while(tokenizer == null || !tokenizer.hasMoreTokens())
			{
				try
				{
					tokenizer = new StringTokenizer(reader.readLine());
				}
				catch(IOException e)
				{
					throw new RuntimeException(e);
				}
			}
			
			return tokenizer.nextToken();
		} while(tokenizer == null || !tokenizer.hasMoreTokens())
			{
				try
				{
					tokenizer = new StringTokenizer(reader.readLine());
				}
				catch(IOException e)
				{
					throw new RuntimeException(e);
				}
			} tokenizer == null || !tokenizer.hasMoreTokens() tokenizer == null tokenizer null !tokenizer.hasMoreTokens() tokenizer.hasMoreTokens() tokenizer.hasMoreTokens tokenizer {
				try
				{
					tokenizer = new StringTokenizer(reader.readLine());
				}
				catch(IOException e)
				{
					throw new RuntimeException(e);
				}
			} try
				{
					tokenizer = new StringTokenizer(reader.readLine());
				}
				catch(IOException e)
				{
					throw new RuntimeException(e);
				} catch(IOException e)
				{
					throw new RuntimeException(e);
				} IOException e {
					throw new RuntimeException(e);
				} throw new RuntimeException(e); new RuntimeException(e) {
					tokenizer = new StringTokenizer(reader.readLine());
				} tokenizer = new StringTokenizer(reader.readLine()) tokenizer new StringTokenizer(reader.readLine()) return tokenizer.nextToken(); tokenizer.nextToken() tokenizer.nextToken tokenizer public int nextInt()
		{
			return Integer.parseInt(next());
		} nextInt {
			return Integer.parseInt(next());
		} return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next public class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		
		int n = in.nextInt();
		int l = in.nextInt();
		int s = 0;
		int z;
		for(int i = 1; i <= n; i++)
		{
			z = l + i - 1;
			s += z;
		}
		
		
		int max = Integer.MAX_VALUE;
		int res = -1;
		for(int i = 1; i <= n; i++)
		{
			int tmp = s - (l + i - 1);
			int cur = Math.abs(s - tmp);
			
			if(cur < max)
			{
				res = i;
				max = cur;
			}
		}
		
		out.println((s - (l + res - 1)));
		out.close();
	}
	
	static class InputReader
	{
		BufferedReader reader;
		StringTokenizer tokenizer;
		
		public InputReader(InputStream stream)
		{
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}
		
		public String next()
		{
			while(tokenizer == null || !tokenizer.hasMoreTokens())
			{
				try
				{
					tokenizer = new StringTokenizer(reader.readLine());
				}
				catch(IOException e)
				{
					throw new RuntimeException(e);
				}
			}
			
			return tokenizer.nextToken();
		}
		
		public int nextInt()
		{
			return Integer.parseInt(next());
		}
	}
} public class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		
		int n = in.nextInt();
		int l = in.nextInt();
		int s = 0;
		int z;
		for(int i = 1; i <= n; i++)
		{
			z = l + i - 1;
			s += z;
		}
		
		
		int max = Integer.MAX_VALUE;
		int res = -1;
		for(int i = 1; i <= n; i++)
		{
			int tmp = s - (l + i - 1);
			int cur = Math.abs(s - tmp);
			
			if(cur < max)
			{
				res = i;
				max = cur;
			}
		}
		
		out.println((s - (l + res - 1)));
		out.close();
	}
	
	static class InputReader
	{
		BufferedReader reader;
		StringTokenizer tokenizer;
		
		public InputReader(InputStream stream)
		{
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}
		
		public String next()
		{
			while(tokenizer == null || !tokenizer.hasMoreTokens())
			{
				try
				{
					tokenizer = new StringTokenizer(reader.readLine());
				}
				catch(IOException e)
				{
					throw new RuntimeException(e);
				}
			}
			
			return tokenizer.nextToken();
		}
		
		public int nextInt()
		{
			return Integer.parseInt(next());
		}
	}
} Main
import java.util.*;
import java.lang.*;
import java.io.*;

public class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		
		int n = in.nextInt();
		int l = in.nextInt();
		int s = 0;
		int z;
		for(int i = 1; i <= n; i++)
		{
			z = l + i - 1;
			s += z;
		}
		
		
		int max = Integer.MAX_VALUE;
		int res = -1;
		for(int i = 1; i <= n; i++)
		{
			int tmp = s - (l + i - 1);
			int cur = Math.abs(s - tmp);
			
			if(cur < max)
			{
				res = i;
				max = cur;
			}
		}
		
		out.println((s - (l + res - 1)));
		out.close();
	}
	
	static class InputReader
	{
		BufferedReader reader;
		StringTokenizer tokenizer;
		
		public InputReader(InputStream stream)
		{
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}
		
		public String next()
		{
			while(tokenizer == null || !tokenizer.hasMoreTokens())
			{
				try
				{
					tokenizer = new StringTokenizer(reader.readLine());
				}
				catch(IOException e)
				{
					throw new RuntimeException(e);
				}
			}
			
			return tokenizer.nextToken();
		}
		
		public int nextInt()
		{
			return Integer.parseInt(next());
		}
	}
}