import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc=new Scanner(System.in);
		
		int n=sc.nextInt();	
		int a=sc.nextInt();	
		
		 int l=a;
		 int r=a+n-1;
		 int eat=0;
		 
		 if(r<=0) {
			 eat=r;
		 }else if(l>=0) {
			 eat=l;
		 }else {
			eat=0;
		 }
		int answer=(r+l)*(r-l+1)/2-eat;
		System.out.println(answer);
		sc.close();
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc=new Scanner(System.in);
		
		int n=sc.nextInt();	
		int a=sc.nextInt();	
		
		 int l=a;
		 int r=a+n-1;
		 int eat=0;
		 
		 if(r<=0) {
			 eat=r;
		 }else if(l>=0) {
			 eat=l;
		 }else {
			eat=0;
		 }
		int answer=(r+l)*(r-l+1)/2-eat;
		System.out.println(answer);
		sc.close();
	}

} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc=new Scanner(System.in);
		
		int n=sc.nextInt();	
		int a=sc.nextInt();	
		
		 int l=a;
		 int r=a+n-1;
		 int eat=0;
		 
		 if(r<=0) {
			 eat=r;
		 }else if(l>=0) {
			 eat=l;
		 }else {
			eat=0;
		 }
		int answer=(r+l)*(r-l+1)/2-eat;
		System.out.println(answer);
		sc.close();
	} main {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc=new Scanner(System.in);
		
		int n=sc.nextInt();	
		int a=sc.nextInt();	
		
		 int l=a;
		 int r=a+n-1;
		 int eat=0;
		 
		 if(r<=0) {
			 eat=r;
		 }else if(l>=0) {
			 eat=l;
		 }else {
			eat=0;
		 }
		int answer=(r+l)*(r-l+1)/2-eat;
		System.out.println(answer);
		sc.close();
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc int a=sc.nextInt(); a sc.nextInt() sc.nextInt sc int l=a; l a int r=a+n-1; r a+n-1 a+n a n 1 int eat=0; eat 0 if(r<=0) {
			 eat=r;
		 }else if(l>=0) {
			 eat=l;
		 }else {
			eat=0;
		 } r<=0 r 0 {
			 eat=r;
		 } eat=r eat r if(l>=0) {
			 eat=l;
		 }else {
			eat=0;
		 } l>=0 l 0 {
			 eat=l;
		 } eat=l eat l {
			eat=0;
		 } eat=0 eat 0 int answer=(r+l)*(r-l+1)/2-eat; answer (r+l)*(r-l+1)/2-eat (r+l)*(r-l+1)/2 (r+l)*(r-l+1) (r+l) r l (r-l+1) r-l r l 1 2 eat System.out.println(answer) System.out.println System.out System System.out answer sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc=new Scanner(System.in);
		
		int n=sc.nextInt();	
		int a=sc.nextInt();	
		
		 int l=a;
		 int r=a+n-1;
		 int eat=0;
		 
		 if(r<=0) {
			 eat=r;
		 }else if(l>=0) {
			 eat=l;
		 }else {
			eat=0;
		 }
		int answer=(r+l)*(r-l+1)/2-eat;
		System.out.println(answer);
		sc.close();
	}

} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc=new Scanner(System.in);
		
		int n=sc.nextInt();	
		int a=sc.nextInt();	
		
		 int l=a;
		 int r=a+n-1;
		 int eat=0;
		 
		 if(r<=0) {
			 eat=r;
		 }else if(l>=0) {
			 eat=l;
		 }else {
			eat=0;
		 }
		int answer=(r+l)*(r-l+1)/2-eat;
		System.out.println(answer);
		sc.close();
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc=new Scanner(System.in);
		
		int n=sc.nextInt();	
		int a=sc.nextInt();	
		
		 int l=a;
		 int r=a+n-1;
		 int eat=0;
		 
		 if(r<=0) {
			 eat=r;
		 }else if(l>=0) {
			 eat=l;
		 }else {
			eat=0;
		 }
		int answer=(r+l)*(r-l+1)/2-eat;
		System.out.println(answer);
		sc.close();
	}

}